Showing posts with label Interview Questions on MS CRM. Show all posts
Showing posts with label Interview Questions on MS CRM. Show all posts

Thursday, September 1, 2011

MS CRM 4.0 Interview Questions - Part 2 (Plugins)

What is Difference between synchronous and asynchronous plugin execution?
Synchronous plug-ins are executed in a pre-defined order as part of the main Microsoft Dynamics CRM event processing. Asynchronous plug-ins are queued and executed independently.

What is an Event Framework?
It is a technology that enables your custom solutions to be developed and integrated into the Microsoft Dynamics CRM server.

What is Unified Event Framework?
The new event framework unifies the separate plug-in and workflow models into a single event model. The unification of event models results in improved system event processing efficiency, a common programming interface for both plug-ins and workflow extensions, and a common deployment programming interface.

Is it possible for a plug-in to execute within the database transaction?
Yes, it is possible for a plug-in to execute within the Microsoft Dynamics CRM database transaction even though the plug-in was registered in a non-transaction pipeline stage

When validation occurs for user under which a plug-in executes?
Validation (privilege checks) of the system user account under which a plug-in executes occurs after the Pre-Event stage. Use caution when registering a pre-event plug-in that modifies data in an external data store because the user has not yet been validated in Microsoft Dynamics CRM when the plug-in code executes.

What is the event execution pipeline?
When a web service method is called by a plug-in or other application it creates a message in the Microsoft Dynamics CRM platform. The message contains business entity information and core operation information. The message is passed through the event execution pipeline where it can be read or modified by the platform core operation and any registered plug-ins. The event pipeline is divided into 5 stages, of which only 2 are available to custom developed plug-ins
  1. Pre-Event (BeforeMainOperationOutsideTransaction)
  2. Pre-Event (BeforeMainOperationInsideTransaction) - For internal use only
  3. Platform Core Operations (MainOperation) - No custom plug-ins can be registered in this stage
  4. Post-Event (AfterMainOperationInsideTransaction) - For internal use only
  5. Post-Event (AfterMainOperationOutsideTransaction)

What are Parent and Child Pipelines?
The event execution pipeline architecture provides the capability for a pipeline to initiate the execution of one or more subordinate pipelines in order to process a request. The originating pipeline is known as the "parent" while the subordinate pipeline is called the "child". Web service method calls typically start a parent pipeline while (internal) platform calls start a child pipeline.

How to get information of Parent Pipeline from Child Pipeline?
The context that is passed to plug-ins of the child pipeline will include the parent context that was executed immediately prior to the child pipeline's invocation. This will enable you to track the parent and child pipeline executions and get more information about what is going on.

How will you get to know that Plug-in is registered as Parent or Child Pipeline?
A plug-in can be registered to be executed from a parent pipeline or a child pipeline. At run time, a plug-in receives information as to how it was invoked through the InvocationSource property of the context that is passed as a parameter to the plug-in.

How will you invoke web service method in Child Pipeline?
In a child pipeline, you must instantiate the CrmService or MetadataService manually. Do not use the IPluginExecutionContext.CreateCrmService or IPluginExecutionContext.CreateMetadataService methods.

What would be the order of execution in a parent-child pipeline execution?
As an example, assume that parent pipeline A invokes child pipeline B during pipeline A's core platform operation. The order of execution will be as follows:
  • Pipeline A : all pre-events are processed.
  • Pipeline A : core platform operation, child pipeline B executed.
    • Pipeline B : all pre-events are processed.
    • Pipeline B : core platform operation.
    • Pipeline B : all post-events are processed.
  • Pipeline A : all post-events are processed.

How to avoid the ‘Denial of Service’ or Deadlocks in a Plug-in?
Infinite loop detection is automatically enabled in plug-ins that call the CreateCrmService method of IPluginExecutionContext to create a proxy to the Web service. For plug-ins that create a Web service proxy by instantiating CrmService, infinite loop detection can be enabled by setting the Web service instance's CorrelationTokenValue property. Plug-in code can obtain the Correlationid, CorrelationUpdatedTime, and Depth property values required by the CorrelationTokenValue instance from the execution context

How would you handle exceptions in Plug-ins?
To handle an error condition, your plug-in can throw InvalidPluginExecutionException exception to show a custom exception message to the user. When the platform receives this exception, it displays the exception message (System.Exception.Message) to the user.

On which message you would require to register the plug-in when an entity state is changed?
SetState and SetStateDynamicEntity messages

On which message you would require to register the plug-in when an entity data is populated in Grid?
Execute and RetrieveMultiple messages

What are the pre-requisite to deploy a plug-in assembly?
  1. It should be written in any .net 2.0 (or above) CLR compliant language
  2. Plug-in assembly must be signed, either by the Signing tab of the project's properties sheet in Microsoft Visual Studio 2005 or the Strong Name tool (sn.exe).
  3. You must add references to the Microsoft.Crm.Sdk and Microsoft.Crm.SdkTypeProxy assemblies that are provided in the SDK\Bin folder of the Microsoft Dynamics CRM SDK samples.
  4. You also have to add a reference for System.Web.Services
  5. Plug-ins must implement the Microsoft.Crm.Sdk.IPlugin interface.

How to pass data between plug-ins?
The message pipeline model provides a PropertyBag collection of System.Object named “SharedVariables” in the execution context that is passed through the pipeline and shared among registered plug-ins. At run time, plug-ins can add, read, or modify properties in the SharedVariables property bag. This provides a method of information communication among plug-ins. This feature is especially useful in chain processing or to communicate information between a plug-in registered for a pre-event and a plug-in registered for a post-event.
Note Only types that are XML serializable should be placed in SharedVariables. All types derived from BusinessEntity are XML serializable.
The following code example shows how to use SharedVariables to pass data from a pre-event registered plug-in to a post-event registered plug-in.

Happy Learning!!!!

Wednesday, July 27, 2011

MS CRM 4.0 Interview Questions - Part 1

1. When dynamic entity should be used?
Ans. The Dynamic Entity class is useful for when your code needs to work on entities and attributes that are not known at the time the code is written. However, this flexibility comes at a price. If your entities are already defined at code time, you should use the strong types provided for you in the WSDL.

2. Which is faster method to retrieve records 'CrmServices.Execute()' or CrmServices.Retrieve()'?
Ans. The CrmService common methods are faster than using the CrmService.Execute method with the corresponding message

3. When 'Execute' message is called in Plugin?
Ans. The Execute message in order to be executed whenever the Microsoft Dynamics CRM Web application retrieves data to populate a grid view

4. What is the Parent /child pipeline?

5. What service you will execute in plugin set as child pipeline?

6. How to create custom workflow and deploy in CRM?

7. How to create plugin and deploy in CRM?

8. Difference between Synchronous and Asynchronous plugin?

9. How to debut Asynchronous plugin?

10. How will you create new organization?

11. Can u modify the business unit in CRM?

12. How you will create user in CRM?

13. What is the difference between table and filtered views?

14. How can u remove system views?

15. How can you create plugin on converting lead to contact/account/opportunity event?

16. How can you deploy plugin and what are the options (settings) available while configuring (deploying) plugin?

17.  How to use impersonation in plugin?

18. How to define default parameter in CRM reports?

19. What web services available in CRM?

20. Which interface you will inherit to create plugin and how will u add your code?

21. If your asynchronous plugin is not working second time then what could be possible reason?

22. How will you handle the exceptions in plugin?

23. How will you check the error detail if any exception come in CRM?

24. How many types of relationships available in CRM?

25. What is the cascading?

26. Will you get the PreImage in create plugin, and PostImage in delete plugin?

27. What are the privileges required for the plugin registration
Ans: The system user account under which the plug-in is being registered must have the following organization wide security privileges:

prvCreatePluginAssembly
prvCreatePluginType
prvCreateSdkMessageProcessingStep
prvCreateSdkMessageProcessingStepImage
prvCreateSdkMessageProcessingStepSecureConfig

Note: The System Administrator and System Customizer roles have these privileges

28. How will you create web services in a plugin used in a child pipeline?

29. How you can add button on grid tool bar?

30. How you can add custom .aspx page in CRM?

31. Can you call plugin from custom button?

32. How many tabs can be added in a CRM page?

33. Can you add more then 8 tab in CRM?

34. Which method is faster RetrieveMultiple or FetchXml, which one should use and why?

35. How can we get data from multiple entities?

36. Difference between Retrieve and RetrieveMultiple?

37. How many events are available to change the form properties on CRM form?

38. How many services are available in CRM?

39. What is the default database structure when CRM is installed? (How many databases are created?)

40. How you can run workflows?

41. Describe Collision Rules for Import and Export or what are the Import Customization Conflicts?

If there are conflicts between objects in the import file and the target system, one of the following actions is taken:

Overwrite. The object definition in the import file overwrites the object on the target system.
Error. A SOAP exception that contains the error code is thrown.
New Object. A new object is created on the target system with the same name.
Skip. The object definition in the import file is skipped.