Que. Explain MS CRM Architecture.
Ans The Microsoft Dynamics CRM event processing subsystem executes plug-ins based on a message pipeline execution model. A Web service method call by a plug-in or other application results in a message being created 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 following figure illustrates the overall architecture of the Microsoft Dynamics CRM platform with respect to both synchronous and asynchronous event processing.

The event pipeline is divided into 5 stages, of which only 2 are available to custom developed plug-ins. Multiple plug-ins that are registered in each stage can be further be ordered (ranked) within that stage during plug-in registration using the Event Framework plug-in registration API.
Stage | Stage Name | Description |
Pre-Event | BeforeMainOperationOutsideTransaction | Stage in the pipeline for plug-ins that are to execute before the main system operation. Pre-Event is raised before the platform core operation and before database transactions are started. |
Pre-Event | BeforeMainOperationInsideTransaction | For internal use only. |
Platform Core Operations | MainOperation | In-transaction main operation of the system, such as create, update, delete, and so on. No custom plug-ins can be registered in this stage. |
Post-Event | AfterMainOperationInsideTransaction | For internal use only. |
Post-Event | AfterMainOperationOutsideTransaction | Stage in the pipeline for plug-ins which are to execute after the main operation. In general plug-ins registered in this stage do not participate in the database transaction. |
Whenever application code or a workflow invokes a Microsoft Dynamics CRM Web service method, a state change in the system occurs that raises an event. The information passed as a parameter to the Web service method is internally packaged up into a Request message and processed by the pipeline. The information in the Request message is passed to the first plug-in registered for that event where it can be read or modified before being passed to the next registered plug-in for that event and so on. Plug-ins receive the message information in the form ofcontext that is passed to their Execute method. The message is also passed to the platform core operation.
Plug-ins can be registered to execute before or after the core platform operation. Pre-event registered plug-ins receive the Request message first and can modify the message information before the message is passed to the core operation. After the core platform operation has completed, the message is passed to the registered post-event plug-ins. These plug-ins have the opportunity to modify the message before the final result, known as the Response, is returned to the application or workflow that invoked the original Web service method call.
Because a single Microsoft Dynamics CRM server can host more than one organization, the execution pipeline is organization specific. There is a virtual pipeline for every organization that is defined in Microsoft Dynamics CRM. Plug-ins registered with the pipeline can only process business data for a single organization. A plug-in that is designed to work with multiple organizations must be registered with each organization's execution pipeline.
Que. What is plugin context?
Ans. All plug-ins must implement the IPlugin interface. The IPlugin interface defines an Execute method, which takes anIPluginExecutionContext parameter. When a system event is fired for which a plug-in is registered, the system creates and populates the context. The system then calls the plug-in's Execute method, passing in the context as a parameter.
There are two methods provided in IPluginExecutionContext: CreateCrmService and CreateMetadataService. We recommend that plug-in code should create an instance of the Microsoft Dynamics CRM Web services through these methods. The platform provides the correct Web service URLs and network credentials for you when you use these methods. However, do not use these methods if you are writing code for a plug-in in that is used in a child pipeline. In a child pipeline, you must instantiate the CrmService or MetadataService manually. For examples about how to call these methods, see the plug-in code provided in the SDK samples.
Que. What is plugin impersonation?
Ans. Through plugin impersonation, plugin in executed with callers(user who performs operation) identity. To enable plugin impersonation, pass parameter as True in execute method.
Que. What is append and appendto functionality?
Ans. 'Append' and 'Append To' priviledges works together. 'Append To' priviledge will allow other entities to get attached with the entity. 'Append' priviledge will allow the entity to attach the records to the entity with 'Append To' privildege.
Let us understand this with simple example:
Let us say that you want to attach a note to a case then note entity should have 'Append' access right and case entity should have 'Append To' access right.
Let us take one more example to understand this. Suppose you have two custom entities called 'TestCustomEntity1' and 'TestCustomEntity2'. You want to attach the 'TestCustomeEntity2' records to 'TestCustomEntity1'records. For this you need to have 'Append' access right on 'TestCustomEntity1' entity and 'Append To' access right on 'TestCustomEntity2'.
Now guess will I be able to attach the records? Answer is "NO" because we need to create a 1:N relationship between 'TestCustomEntity1' and 'TestCustomEntity2'.
Now the user who has above mentioned access right in his security role will only be able to add 'TestCustomEntity2' records to 'TestCustomEntity1'.
Que. How many tabs you can have on form?
Ans. 8
Que. Can we increase the number of tabs?
Ans. yes
Que. What is default size of attachment you can have on email activity?
Ans. 5 mb
Que. CRM Form types
Ans. Is the user creating a new record?
crmForm.FormType == 1
Is the user updating an existing record
crmForm.FormType ==2
Is the user unable to update this record?
crmForm.FormType == 3
Is this record deactivated?
crmForm.FormType == 4
Is the user using the Quick Create form?
crmForm.FormType == 5
Is the user using the Bulk Edit form?
crmForm.FormType == 6
What is the unique ID for this record?
= crmForm.ObjectId
What type of record is this?
= crmForm.ObjectTypeCode
What type of record is this (Entity Name)?
= crmForm.ObjectTypeName
Is the user using the Outlook Client?
crmForm.IsForOutlookClient==true
Is the user using the Outlook Light Client?
crmForm.IsForOutlookLightClient == true
Is the user working On line?
crmForm.IsOnline==true
Have any fields in this form been changed?
crmForm.IsDirty==true
Que. What is 1:1, 1:N and N:N relationship?
Ans. 1:1 is self referential relationship where entity is having relationship with itself.
1:N is one to many relationship between two entities. Its used to have lookup on form.
N:N is many to many relationship between entities.
Que. What is entity moniker?
Ans. To Create N:N relationship through SDK entity moniker is used.
Que. How can we use join clause in query expression?
Ans. Using link entities
Que. What is CRM Service?
Ans, CRM Service is the main web service and it exposes Six methods such that you can write your code against CRM entities. To perform operation other than the six operations (six methods provided by mscrm) we will have to use the Execute method.
Que. What is metadata service? Where we can use metadata service?
Ans. Dictionary meaning of the word METADATA is data about data and similarly the metadata holds the information about MSCRM means the information about the entity and attribute e.g. Display name, platform name, size of the attribute, datatype of attribute etc. If we want to access any information about any entity (Dynamic or system) we will have to make use of the Metadata service. In the database we can find the metadata table and name of these table begins with keyword Metadata.
Que. What is discovery service?
Ans. The Discovery service is a global service that helps the caller to detemine the correct organization and URL. Microsoft CRM server may include several servers. Each server might be dedicated to multiple organization. Each of these servers will have dedicated web-service URL for faster operations. Internally the Microsoft CRM server allocation may change so the discovery service directs the request to its corresponding web-server for further processing.
In short the Discovery service responsibility is to find the 'CRM Service' and 'Metadata Service' urls.
The discovery service returns the list of organization URLs that the current-requester (current user) belongs to. During the Outlook client configuration discovery service shows he list of organization the current-user belongs to.
This web-service is used to create authentication ticket in case of Windows live authentication.
Que. What is dynamic entity? Its significance
Ans. Dynamic entity is used to create a Custom Entity record using SDK
Que.Where to use plugin and where to use workflow?
Ans. Synchronous Action - use plugin.
Asynchronous action - use workflow
Que. Suppose if I have 20 user license and I have created 20users. What will happen if I create 21st User?
Ans: The 21st User will get created in MSCRM but that user will be in disabled state.
Que. What is difference between role based and object based security in MSCRM?
Ans. Code based security is entirely coded in the application itself. Role based security uses one of the authentication/authorization mechanisms of the application server.
The other form of security applies to individual instance of objects. There is fundamental difference between an access right and a previlege: an access right is a right granted to a user on an object, but previlege is a right granted to a user on class of objects.
Que. What are new feature in CRM 4.0 ?
Ans.
- Multiple organizations can be hosted and WSDL APIs are now unique per organization in MSCRM 4.0
- Plugin and workflow now use the same event framework, allowing even more extensibility
- Many to many relationship was not available in MSCRM 3.0
- Multicurrency feature was not available in MSCRM 3.0
- Plugin were called callout in MSCRM 3.0 and after registering the callout everytime we have reset IIS, which is not the case in Plugin.
Ans No, we need to re install MSCRM
• What is plugin?
• What type of plugin you have written?
• What is workflow?
• What is Queue in MSCRM?
• Have you ever done any no supported work in MS CRM?if yes what?
• Write sample query expression to retrieve data?
• Have u ever worked on Integration project? Like CRM integration with any other application.
• How will you show popup (dialog box) when you are getting any error in plugin?
• What is filtered view?
I have some questions regarding the use of plug-in vs. workflow.
ReplyDeleteYour blog states that :
-Synchronous Action - use plug-in.
-Asynchronous action - use workflow
1. what are Asynchronous plugins for ?
2. When we can use Asynchronous plugins to do an Asynchronous action then why we need workflows ?
3. How do a plug-in and a workflow exactly differ other than above mentioned scenarios ?
Thanks,
Subbu
Good Catch Subbu.. Below question and its answer will reply to all your queries..
ReplyDeleteWhen to Use an Asynchronous Plugin?
· You want the code to run under the current user's credentials or a set user's credentials. Workflows run under the service account's credentials.
· If you have want to store configuration information that is confidential such as a username/password.
o Plugins store their configuration in a secure location. It is set and viewed through the plugin registration tool. Only deployment admins can see it, so you don't have to worry about the credentials being compromised (at least not by very many people).
While in Workflow there is no such provision.
Hey Kunal, Sorry dude I did not see your reply till today. But still there is a catch in you answer.
ReplyDeleteIn custom workflow too we can use impersonation, to perform the operation with any user credentials.
However, storing the custom configuration is surely an issue though.
But still is this the only that differs the Async plugins and workflows.
Also my question is still unanswered...why we need workflows when we can do it with Async Plugin?