You are on page 1of 62

SQL:

Fun/SP:
Stored Procedure (SP) Function (UDF - User Defined
Function)

SP can return zero, single or multiple values. Function must return a single value (which
may be a scalar or a table).
We can use transaction in SP. We can't use transaction in UDF.
SP can have input/output parameter. Only input parameter.
We can call function from SP. We can't call SP from function.
We can't use SP in SELECT/WHERE/ We can use UDF in SELECT/ WHERE/
HAVING statement. HAVING statement.

We can use exception handling using Try- We can't use Try-Catch block in UDF.
Catch block in SP.

An index is used to speed up the performance of queries. It does this by reducing the number of
database data pages that have to be visited/scanned.
In SQL Server, a clustered index determines the physical order of data in a table. There can be
only one clustered index per table (the clustered index IS the table). All other indexes on a table
are termed non-clustered.
[ Online Report, Online Plugin, Report (if Online CRM how to deploy), Business rules, business
process, Number of fields in single entity 1024, Plugin, Dialog (call plugin/WF), Action, WF,
sync/Async (Plugin/WF) real-time WF, report type (online -> onprimses). Also, migration from
2013 to 2015, inifinte loop in plugin, online string map db access, ]
Process Category: Action, Business Process Flow, Work Flow, Dialog

What are the new type of workflows introduced in MS CRM2013.


Action and Business Process workflow.

What is the Business Rules in MS CRM?


Business Rules feature in MS Dynamics CRM gives us a lot of conditional functionalities that
we can attach to fields on a form without using codes. Business rules in Dynamics CRM offers
several user-friendly features. Before introducing business rules, these functionalities were
achieved using JavaScript.
Scope: Entity (Server side), Form (client side).
Limitation:
 One of the limitations of business rules is that they are not executed during bulk edits and
imports.
 We can’t debug and trace business rules like we do the JavaScript.
 The actions that can be performed using business rules are limited compared to the
requirements a developer must meet, like setting a field value by appending two other field
values and hence forces them to depend on JavaScript.
 Also, business rules are launched in the order they are activated. So one has to know all the
business rules and the order in which they are to be executed in an entity.
 The number of If…Else statements in a business rule is limited to 10.
 The execution of a business rule is always enforced. There is no control over their execution.
When a JavaScript and business rule acts on the same field of a form, the precedence is for
System JavaScript followed by Custom JavaScript and then business rules.
 A JavaScript cannot be called from a business rule.
 A business rule can be acted only on the fields of local entities and not on the fields like
look up of related entities or parent entities.
 Business rules can’t interact with tabs and sections.

Business Rules, JavaScript Method which one trigger the first?


JavaScript method is client side program and synchronous while business rules are asynchronous
process so JavaScript execute first.

What is the real-time workflow (sync WF)?


Real-time (synchronous) workflows run and hold you up until they're complete - the workflow
starts immediately, and the user must wait for the workflow to be completed.
(Synchronous means that next operations cannot be performed until this operation is finished.
So, if you save the account and the synchronous workflow is triggered, you cannot do anything
before it is finished - so basically you are sure that when you have back your control over CRM,
the workflow has finished its work.)
Asynchronous workflows run in the background - the execution would not start immediately,
and the user does not have to wait until the workflow completes.
(you are expecting that the operation will be done "behind the scenes" without interrupting the
main operation. So, for example, you are saving the record and that triggers asynchronous
workflow. Your record is being saved, the workflow starts. When the saving finishes, you can
continue working in CRM, open other records, do some other stuff. In the meantime, the
workflow is running and you are not aware of that - it does not affect your work, as it is done by
a background task.)
Real-time workflow trigger first or plugin will trigger first?
By default, plugin will trigger first.

How should is change execution order between synchronous workflow and Plugin?
we have tool synchronous event order in Toolbox by using we can able to update Rank of
workflow.

Plugin WF 1st Execute


pre-validation Synchronous Plugin
per-operation Synchronous Plugin
post-operation Synchronous WF
post-operation Asynchronous WF
post-operation Asynchronous Plugin

What is the difference between Role Based and Object Based Security Model in MSCRM?

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 fundamental concept in role-based security is that of privilege, defined at design time, on a
system-wide basis. Each user has a set of privileges (there are well over a hundred privileges)
that are enabled for that user. However, Policies and Roles grant privileges and simplify the
process.
The other form of security applies to individual instances of objects. There is a fundamental
difference between an access right and a privilege: an access right is a right granted to a user on
an object), but a privilege is a right granted to a user on a class of objects. Access rights apply
only after privileges have taken effect. In other words, if a user does not have the privilege to
read accounts, the user will not be able to read any account, whether it has been shared.

Difference between Find and Advanced Find? Which one is faster and Why?

Find perform a search on an attribute for which it is defined. Advanced Find perform search on
the conditions and the attributes for which user customizes or runs it. Normal Find in faster as it
looks for one attributes and matches with that and returns the result whereas Advanced Find
searches for all the attributes and conditions while parsing through the records.

Find is applicable on only active records and it finds only on 2 or 3 column which we have
defined in the find view and even it returns any those column which is there in the view but
advanced find is applicable to all the records and it finds all the columns and even it returns all
the column and filter criteria can be on any column and most important - find filters on just one
condition but adv. find filters on multiple condition at one time. Find is faster than Advanced
Find.

Difference between CRM Discovery Service and CRM Metadata service?

CRM Discovery Service - when we need ORG related information like ORG name, Properties,
CRM service path for this ORG -- then we use CRM discovery service. This is only to get the
ORG related information
Meta data service - we use this when we need to interact with the CRM records – create, update
or delete anything-- it is very specific to the CRM records. When we need to interact with the
CRM entity and attribute -- like create an entity (not record) or attribute -- add a value to pick
list-- retrieve the pick list value retrieve the entity properties-- attribute property and all we need
Meta data service.

Difference between Plug-in and Workflows?

Requirement Plug-in Workflow Needs a synchronous action to happen before or after an event
occurs. The same piece of logic will be executed for different events and possibly on different
entities The logic needs to be executed while offline Needs elevation of privileges
(impersonation)Needs to execute on events other than assign, create, update, set state The
process/logic may take a long time to complete or will be a persistent process (multiple long
running steps) needs an asynchronous actioned users will need to modify the process logic Child
sub processes will be triggered.

Whenever you install MSCRM what all databases get created?

MSCRM_Config and MSCRM_orgname

Whenever you install MSCRM what all user groups get created in Active Directory?

UserGroupAll Microsoft CRM users. This group is updated automatically as users are added and
removed from Microsoft CRM.
ReportingGroupA group that contains all users within Microsoft CRM. This group is updated as
users are added to Microsoft CRM. Users in this group have read-only access to the filtered
views in the Microsoft CRM database.
PrivUserGroupPrivileged Microsoft CRM user group for special administrative functions.
SQLAccessGroupA group that contains Microsoft CRM ASP.NET account and other service
accounts. Members in this group have full access to the Microsoft CRM database and this group
is used by the Microsoft CRM platform layer. End users should never be added to this group

What is 'Append' and 'Append To' privilege in MSCRM? Give one example of it?
'Append' and 'Append To' privileges works together. 'Append To' privilege will allow other
entities to get attached with the entity. 'Append' privilege will allow the entity to attach the
records to the entity with 'Append To' privilege. 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.
Can we modify the name of Root Business Unit?
No; we must re-install MSCRM.
Suppose if I have 20 user license and I have created 20users. What will happen if I create
21st User?
The 21st User will get created in MSCRM but that user will be in disabled state.
What is the maximum number of tabs allowed on a Microsoft Dynamics CRM 4.0 forms?
8
How to enable/disable the form assistant? How to make sure the form assistant is
expanded/collapsed on a form?
Navigate to Customization >> Open the Entity >> Open Forms and Views >> Open Form >>
Select Form Properties >> Open Display Tab >> Check/Uncheck the " Enable the Form
Assistant" and " Expanded by Default”.
What was your role in the MSCRM implementation project that you have worked on?
You should be honest while giving answer to this question and should give a brief overview of
the project and your role. This is very important question because the answers of this question
will trigger so many questions. You should highlight the key skills you have; this way you will
divert the attention of the interviewer to your key skills and try not to expose the area in which
you are less confident.
What was the most challenging task you have faced till now?
Here you should give answer that exhibits your positive attitude. E.g. for a technical consultant it
may be something like ... " I was new to the support and during this experience i faced
challenging issue related to plug-in that improved my debugging skills. Email-to-case plug-in
was difficult as we had to take care of so many conditions. I have learnt one thing during my
previous assignment and that is 'Never give-up'“.
Do you have a few key best practices someone considering CRM can use?
Yes, I have three that anyone can use. First, consider your future needs. Look down the road and
ask “How many contacts will I have in five years?” “How many salespeople will I have?” “How
many of my people will need real-time access to this information at home or on their phones and
PDAs?” “How much would it cost me to replace these contacts?”
Second, take the opportunity to clean up your data now. Moving to a CRM solution is an
opportunity to start with a clean version of accurate data. De-duplicate and otherwise scrub the
data to minimize the possibility of needing to import twice. For example, the flexibility of Excel
and Outlook BCM allow placing incorrectly formatted information in their fields. This data will
not import well without some good planning.
Third, be sure to communicate throughout the process and get early buy-in. The biggest focus of
Saleforce.com with its customers is adoption. Members of your team are influencers in their
departments. Leverage their expertise and influence by building a team to help you make
decisions about the solution. Even if you disagree, listening, acknowledging, and respecting will
build loyalty and acceptance within the process.
What advantages might CRM have for specific verticals?
The answer to this question is not if but how much. Since CRM helps you do what you do better,
if you are in a professional services company with long sales cycles, project terms, and frequent
interactions and touch points, CRM will be exponentially more valuable to you. So service
businesses, like lawyers, consultants, and accountants, are ripe for CRM but often have a
technological aversion and a strong status quo to maintain.
Does CRM fall more to sales or marketing in most organizations?
In my experience, marketing is somewhat of a new concept in CRM. Sales is involved, but most
often it is operations leading the charge.
What are my best resources for finding out more about CRM?
SDK
___________________________________________________________________________________

How many Web Services are in MSCRM?


1. Deployment Web Service
Using this service, we can
· Create or import organizations
· Enable and Disable organizations
· Add deployment administrators
· Configure IFD and Claims-based authentication

2. Discovery Web service


Using this service, we can
· Identify the organization information available in a deployment
3. IOrganization Service
IOrganization service endpoint that includes both data and metadata

What was the size of the implementation?


The number of user-licenses.

Suppose I want to migrate Microsoft CRM implementation from one environment to other
environment. Let us assume that there a published workflow for account entity. Now in normal
usage there will be few accounts-records for which the workflow will be waiting/Waiting for
Resource/Failed/Succeeded state. So what should be our strategy for the migration? What will
happen to the records which are in waiting state and what will happen to the records which are in-
progress?

Suppose there is a plug-in registered for account entity. When a user submits a request (e.g.
account creation etc.) to the web-server then what will happen in the server?
The plug-in will get loaded into the memory and will perform the operation it is needed to do.

Now what will happen if 100 users will submit the request to the web-server? The plug-in code will
get loaded into the memory for 100 times?
Answer is NO. Noticeable point over here is that the Microsoft CRM is a managed application and runs
under .Net framework. So, whenever the first request arrives at the web-server the plug-in code is loaded
into the memory and will perform its operation and subsequently the same plug-in code will serve the
process for other user as well. So, this way it saves the amount of time required to load the plug-in into
the memory. If the plug-in code is not being used for long, then the Garbage collector will identify it and
will sweep the plug-in out from the memory.

How to add/remove columns in an entity lookup window?


Go to Settings >> Customization >> Select the entity >> Click ‘Forms and Views in the Left Nav Pane”
>> Double click the ‘Entity Lookup View’ >> Dialog box appears that contains the Add/Remove and
Sorting options for a lookup view.

How to debug the java script that we write for some validation on entity pages?
Following are the steps that are needed to be followed:
· Enable the Debugging in the Internet Explorer – Go to Tools >> Internet Options (wizard will
appear >> Click the ‘Advanced Tab’ >> Under Browsing Section uncheck the ‘Disable script debugging’
checkbox >> Click OK.
· Edit the java script code of the Entity Page that you want to debug.
· Put the statement ‘debugger;’ above the line where you want to do the debugging.
e.g. suppose my java-script show ‘Hello World’ message and i want to debug this then following is the
way I am going to add script:
debugger;
alert (‘Hello World’)
· Save and Publish corresponding customization.
· Perform the operation that would trigger the java script written by you
· Debugger dialog box will appear and select appropriate debugger (Visual Studio new or existing
instance)

What are basic security permissions at domain level?


(priv reporting group, privUser group, SQL Reporting group… total 5 groups availble google it.)
Description
AD Name
SQLAccessGroup
The members of this group get access to CRM filtered views
CRM user group for special administrative functions;
PrivUserGroup Including CRMAppPool identity (domain user or
NetworkService). The users who configure CRM must be
added to this group.

PrivReportingGroup This group create during CRM Server Setup and


configured during CRM Reporting Extensions Setup.
All CRM users are included in this group.This group is
ReportingGroup updated automatically as users are added and removed from
CRM. By default, all CRM Reporting Services reports grant
Browse permission to this group.

For plugin deployment, Difference between GAC, Database, Disk deployments?

Database: The assembly dll is stored in the database, rather than the file system. The major
advantages are that the assembly need only be deployed once if you have multiple CRM servers,
and that no additional action is required to restore / redeploy the assembly either during disaster
recovery, or if redeploying to an alternate server. This is the preferred option in a production
environment
Disk: The assembly dll is placed in the \server\bin\assembly directory on each server. You must
ensure the dll is placed in the correct place on all CRM servers, so the deployment overhead is a
little greater. I normally use this option in development environments as you can redeploy newer
versions solely by file transfer, rather than reregistering. Also, if debugging, the assembly .pdb
file needs to be placed in the same location; with this option, it's easy to ensure the dll and pdb
are from the same build
GAC: The assembly is placed in the Global Assembly Cache on each CRM server, and again
you must do this. The GAC does allow multiple versions of an assembly, but CRM doesn't, so
you don't really gain anything by using the GAC. I don't think I've ever used this option
Difference between CRM web services vs. CRM.SDK Proxy namespaces?

Calling Dynamic Entities (knowledge on Moniker, Input Parameters, Output Parameters, and
Meta Services)?

How many numbers of tabs available in MS CRM Entity Form?


Officially max 8 tabs, unofficially we can do plenty (It’s not recommended by Microsoft CRM)

Explain in details about the event execution pipeline?


The event execution pipeline allows you to configure when in the event the plug-in code will execute.
The event pipeline is Pre-event (Pre-Validation, Pre-Operation), Post-event (post-operation). Before or
after save.
When do we register a plugin in child pipeline? Give examples?
Quote can be created in 2 ways, through the home screen OR the opportunity screen. If you create it from
the latter, it will run on the child pipeline and you will find that your plugin will not work.

What are images? Why are they used?


Plugins in Dynamics CRM, allow you to register images against the steps of a plugin assembly. Images
are a way to pass the image of the record that is currently being worked upon prior or after the action has
been performed. In general, it could be said, it is the image of the record as is available in the SQL
backend.

Two types of Images are supported, Pre-Image and Post Image.

In case of Pre-image, you get the image of the record as is stored in the SQL database before the CRM
Platform action has been performed.
Post Image, returns the image of the record after the CRM Platform action has been performed.

What is early binding and late binding. How is it used in CRM?


Early Binding:
Compiler bind the objects to methods at the compile time. This is called early binding or static binding.
Function overloading is example for early binding.

Late Binding:
Compiler bind the objects to methods at the runtime. This is called late binding or dynamic binding.
Function overriding is example for late binding.

What is PrinciplalObjectAccess table why is it used?


The POA table is used to provide access to specific records for CRM users, and each record in the POA
table represents one CRM object that is related to one CRM user. Records created in the POA table come
from one of four ways:
· Share reassigned records with original owner: CRM System Settings
o If this is set to Yes, then records would be added to the POA table whenever an assign takes
place. These records will have a value in the AccessRightsMask colum of the POA table.
· Direct sharing: Actions – Sharing
o When users explicitly share a record to another user, a record would be created in the POA
table. These records will have a value in the AccessRightsMask colum of the POA table.
· Reparent Setting: Relationship Behavior
o Each entity has relationships with other entities (ex. Account to Case). By default, the Reparent
option is set to Cascade All. With this setting, sub records would be shared to the owner of the parent
record. For example: Let’s say that User1 owns Account1. User2 has access to Account1 and creates a
case underneath Account1. With the out of the box Reparent options, a record would be created in the
POA table that would give User1 access to the newly created case. These records will have a value in the
InheritedAccessRightsMask colum of the POA table.
· Indirect Sharing: When sharing occurs through a direct share, assignment, or parenting, if the
relationship is set up to cascade the share to child records, additional records will be created in the POA
table in order to give proper permissions to the new user for the relevant child records. These records will
have a value in the InheritedAccessRightsMask colum of the POA table.
What is the use of stringmap table?
stringmap table used to store picklist value in ms crm.

When can infinite loop occur in a plugin? How do you avoid infinite loops in plugin code?
An infinite plugin loop example is: You have a post-update plugin on an entity 'A' that
updates something in entity 'B' and entity 'B' has a post update plugin that updates
plugin 'A'. Or You have a post-update plugin on an entity 'A' that updates a field in the
same entity 'A', when entity 'A' will be updated, it will result in another update of entity
'A' and this will go on and will result in infinite loop.

Now, lets come to 'How we can stop it from happening?' There is a property called
Depth for Context object. You can use this property to check if you are heading to an
infinite loop. If context.Depth > 1, then you have a case of plugin causing a call to
itself. The Depth attribute increments each time a plugin causes another plugin to
execute. So you could check the contact plugin context. Depth is not larger then 2 if
you want it to still fire at least once from the account plugin.

Every time a running plug-in or Workflow issues a message request to the Web services
that triggers another plug-in or Workflow to execute, the Depth property of the
execution context is increased. If the depth property increments to its maximum value
within the configured time limit, the platform considers this behavior an infinite loop
and further plug-in or Workflow execution is aborted. The maximum depth (8) and time
limit (one hour) are configurable by the Microsoft Dynamics CRM administrator.

How many types of relationships are available in crm?


3 types
1: N
N: 1
N: N

What is the difference when the ownership is user vs. organization for a custom entity?
Organization-owned entities typically contain data involving something that belongs to or that can be
viewed by the whole organization. Organization-owned entities cannot be assigned or shared. For
example, products are owned by the organization.
User-owned entities are associated with a user. User-owned entities typically contain data that relates to
customers, such as accounts or contacts. Security can be defined according the business unit for the user.

What are filtered views?


SQL database views, called "filtered views," are provided with the Microsoft CRM database to enable
access to business data according to the user's Microsoft CRM security role. When a user runs a report
that obtains data from filtered views, the user's Microsoft CRM security role determines the data to be
included in the report. Data in filtered views is restricted at three levels: the organization, the business
unit, and the owner. Filtered views exist for all Microsoft CRM business objects (entities).
Your reports should not read data directly from the Microsoft CRM database tables. Instead, use the
filtered views. The following sample SQL code returns all columns from the filtered view for an Account
entity:
SELECT * FROM dbo.FilteredAccount
If you delete a record from UI, what happens in database? Can you bring the record back? OR,
what is deletion service? Can you change its schedule?
In Microsoft Dynamics CRM, deleting an entity by using the Web application or through SDK Web
service calls usually results in a "soft delete" where the entity is not immediately deleted from the
database. Instead, the entity is marked for deletion later. The platform marks the entity for deletion by
setting the entity's DeletionStateCode attribute to 2. Entities with a DeletionStateCode attribute set to 2
are filtered out from all data views in the Web application and are not accessible using the SDK.
These marked entities are physically deleted from the database by the Deletion Service. The Deletion
Service is an asynchronous operation that is based on a table named
ScaleGroupOrganizationMaintenanceJobs in the MSCRM_CONFIG database of Microsoft Dynamics
CRM. By default, the frequency of the Deletion Service job execution is set to once a day. You can use
the Scale Group Job Editor tool to change the execution frequency of the Deletion Service. You can find
the tool on the Web at http://code.msdn.microsoft.com/ScaleGroupJobEditor.

Can you call a plugin using JavaScript?


You can accomplish this by creating a custom entity you want to use as a trigger. You attach your plugin
to that entity either at the create message or the update message (requires you to have one record created
that you update).
Now, in Jscript, when you want to call the entity all you have to do is call the update or create for that
custom entity (depending on which message you attached your plugin to). This way you can fire your
plugin from anywhere you can access jscript.

In what circumstances are dialogs useful?


Dialogs are the synchronous/interactive processes in Microsoft Dynamics CRM 2011 and Microsoft
Dynamics CRM Online that collect and process information by using step-by-step scripts to direct users
through a process. For example, you can create dialogs to act as a guide for your service representatives
for case resolution and case escalation. Similarly, you can create dialogs for standardizing sales processes
such as opportunity qualification and lead scoring.
Every time you run a dialog in Microsoft Dynamics CRM, a ProcessSession (dialog session) record is
created. The dialog session stores the session log about the dialog process that was run.

Owing to the interactive nature of the dialog process, you cannot run a dialog using the
Microsoft Dynamics CRM SDK. A dialog can only be run through the Microsoft
Note Dynamics CRM Web application and are not supported in Microsoft Dynamics CRM for
Microsoft Office Outlook with Offline Access

When would you use a pre validation plugin and when would you use a post validation
plugin?
Pre-validation:- Stage in the pipeline for plug-ins that are to execute before the main system operation.
Plug-ins registered in this stage may execute outside the database transaction.
Pre-operation:- Stage in the pipeline for plug-ins that are to execute before the main system operation.
Plug-ins registered in this stage are executed within the database transaction.
Post-operation:- Stage in the pipeline for plug-ins which are to execute after the main operation. Plug-ins
registered in this stage are executed within the database transaction.
Post-operation:- Stage in the pipeline for plug-ins which are to execute after the main operation. Plug-ins
registered in this stage may execute outside the database transaction. This stage only supports Microsoft
Dynamics CRM 4.0 based plug-ins.
Why use images with plugins?
Answer: Images are a way to pass the image of the record that is currently being worked upon prior or
after the action has been performed. In general it could be said, it is the image of the record as is available
in the SQL backend.

Two types of Images are supported, Pre-Image and Post Image.

In case of Pre-image, you get the image of the record as is stored in the SQL database before the CRM
Platform action has been performed.
Post Image, returns the image of the record after the CRM Platform action has been performed.

Explain how solutions work, managed and unmanaged?


Unmanaged Solutions
All solutions start out as Unmanaged. When it is in the unmanaged state, you can add, remove, update,
test any of the components of the solution. You can delete components of your unmanaged solutions,
while leaving it available for use in the rest of the system. Some on the MS CRM dev team have likened
this to your 'source' code of your system. The great thing about an Unmanaged Solution is that during
development, you can create restrictions (like 'not customizable') on the components as they evolve.
Managed Solutions
When your unmanaged solution is ready for the show, you simply export it to 'Managed'. You could
think of this as 'compiling' you code. You set the restrictions (i.e. prevent customizations on certain
components) and the end user lives by those rules. But remember, they can still customize the
components of the solution that are unrestricted. You cannot add or remove components of a solution,
even if the component is unmanaged.
Once you have packaged the Managed Solution, it can be installed into another organization. They can
also be deployed across multiple deployment types (Online, Partner Hosted, On-Premise) and all CRM
Clients (web, Outlook, Mobile Express, and Offline via Outlook Client).

What does the CRM asynchronous service do?


The asynchronous service executes long-running operations independent of the main Microsoft Dynamics
CRM system process. This results in improved overall system performance and improved scalability.
The asynchronous service features a managed queue for the execution of asynchronous registered plug-
ins, workflows, and operations such as bulk mail, bulk import, and campaign activity propagation. These
operations are registered with the asynchronous service and executed later when the service processes its
queue. All workflows are executed by the asynchronous service.

What is an Email-Router?
Microsoft Dynamics CRM E-mail Router is a software component that creates an interface between a
Microsoft Dynamics CRM deployment and the organization's messaging system. The E-mail Router
routes qualified email messages to the Microsoft Dynamics CRM system as email activities and fully
integrates with different messaging systems, such as Microsoft Exchange Server, Microsoft Exchange
Online, POP3, and SMTP. The E-mail Router includes the functionality for sending email through any
desired SMTP provider and for receiving email from Microsoft Exchange Server or from a POP3 server.
Additionally, the Forward Mailbox feature remains available.

What is Metadata service of MSCRM?


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 attributes e.g. Display name,
platform name, size of the attribute, data type 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 tables begins with keyword Metadata.
1. What is the use of Secondary Entity within Plugin Registration Tool in MSCRM 2011?

Secondary Entity use when you have to retrieve record from Intersect Entity (contactleads) having
records of Entities (Contact and Lead) having N: N Relationship.

2. When is ‘Secondary Entity’ required?

The following 2 messages require the ‘Secondary Entity’ to be specified while registering a step in Plugin
registration: a) SetRelated b) RemoveRelated

3. What are the supported ‘Secondary Entities’?

Primary Entity Secondary Entity Supported Relationships

Invoice Contact contactinvoices_association

Lead Account accountleads_association

Lead Contact contactleads_association

Opportunity Account opportunity_customer_accounts

Opportunity Contact opportunity_customer_contacts

Opportunity Competitor opportunitycompetitors_associationor

Product Lead leadproduct_association

Product Competitor competitorproduct_association

Quote Contact contactquotes_association

SalesLiterature Competitor competitorsalesliterature_association

SalesLiterature Product productsalesliterature_association

SalesOrder Contact contactorders_association

4. What does ‘SetRelated’ and ‘RemovedRelated’ do

These two messages are basically triggered when a primary entity record is
associated/dissociated with/from the secondary entity record via the relationships supported.
So, if you’re planning to execute some business logic on association of the specific entities, you
can register the plugin against the ‘SetRelated’ message. The ‘RemoveRelated’ works for
dissociation of the entity records from each other.
Plugin Interview Questions:

1. Explain in details about the event execution pipeline.

The event execution pipeline allows you to configure when in the even the plug-in code will
execute. The event pipeline is Pre-event (Pre-Validation, Pre-Operation), Post-event (post-
operation). Before or after save.

2. when do we register a plugin in child pipeline. give examples

3. What are images. Why are they used.

The pre/post images return the data as it is stored in the CRM database. One scenario
where the pre-image can be useful is during an Update event when you need to get a
value whether or not it was updated (since only updated fields are available in the
input). Post-image can be used to see the final value after all of the business logic has
run (example the Quote ID generated OnSave).
http://www.inogic.com/blog/2010/07/pre-image-post-image-explained/

 One of the best uses for this is in update plug-ins. As mentioned before, update
plug-in target entity only contains the updated attributes. However, often the plug-
in will require information from other attributes as well. Instead of issuing a
retrieve, the best practice is to push the required data in an image instead.
 Comparison of data before and after. This allows for various audit-type plugins, that
logs what the value was before and after, or calculating the time spent in a stage or
status.

4. What is early binding and late binding. How is it used in CRM

Code snippet 1 (Late binding) :


Entity e =new Entity();
e.LogicalName = "account";
e.Attributes["new_firstname"] = "data";
_serviceProxy.Create(e);
Code snippet 2 (Early binding) :
Account account = new Account { FirstName = "data" };
_serviceProxy.Create(account);
early binding is practically a wrapper around to the standard classes to speed up the
development.
It has also some bonus like the possibility to use LINQ.
You can always choose both, there are no limitations. Personally I prefer late bound,
especially for plugin development.

late bound is faster than early bound, but if your application doesn't require speed
performances this is not the main criteria to choose between late bound and early bound.
Early Binding:

Advantage:

In Microsoft Dynamics CRM 2013 /2011 Software Development Kit contains with a tool (CrmSvcUtil)
which can automatically generate helper classes to make it easier to work with your CRM entities
and their attributes. You can also generate helper class from MS Visual Studio (greater than 2010
version) if you install CRM SDK Developer tool kit package and connect to CRM organization then
generate wrapper class. This provides type checking at compile time, which eliminates the chance of
running into InvalidCastExceptions during execution of your custom code. It also lets developers
take advantage of intellisense by suggesting names for entities, attributes, and relationships. This
can speed up development time by removing the risk of spelling mistakes.

Disadvantage

Every time you make a customization change in your system, you will need to run the CrmSvcUtil
tool again to ensure that the latest entities, attributes, and relationships are available in your custom
applications. The size of the generated file can be large depending on the complexity of your
system. Use of the Helper class results in slightly lower performance than the Late-bound entity
types.

Late Binding

Advantage

Late binding involves the use of the generic “Entity” class which can manage objects of any entity
type. For example, we can use the “Entity” object to programmatically create Accounts, Contacts,
Leads, or any custom entity. So in this case we have to define everything explicitly, so here no need
to generate helper class again and again. Use of the Entity class results in slightly better
performance than the early-bound entity types.

Disadvantage

Type checking is performed at runtime, so developers must explicitly cast attribute values correctly
otherwise the custom code will fail during execution. Developers need to be familiar with the late
binding syntax as there is no intellisense available.

5. How do you debug plugin


By Me……………

6. when can infinite loop occur in a plugin. How do you avoid infinite loops in plugin code.

An infinite plugin loop example is: You have a post-update plugin on an entity 'A' that
updates something in entity 'B' and entity 'B' has a post update plugin that updates
plugin 'A'. Or You have a post-update plugin on an entity 'A' that updates a field in the
same entity 'A', when entity 'A' will be updated, it will result in another update of entity
'A' and this will go on and will result in infinite loop.

Now, lets come to 'How we can stop it from happening?' There is a property called
Depth for Context object. You can use this property to check if you are heading to an
infinite loop. If context.Depth > 1, then you have a case of plugin causing a call to
itself. The Depth attribute increments each time a plugin causes another plugin to
execute. So you could check the contact plugin context. Depth is not larger then 2 if
you want it to still fire at least once from the account plugin.

Every time a running plug-in or Workflow issues a message request to the Web services
that triggers another plug-in or Workflow to execute, the Depth property of the
execution context is increased. If the depth property increments to its maximum value
within the configured time limit, the platform considers this behavior an infinite loop
and further plug-in or Workflow execution is aborted. The maximum depth (8) and time
limit (one hour) are configurable by the Microsoft Dynamics CRM administrator.

___________________________________--

When developing plugins for Microsoft Dynamics CRM 2011, there are scenarios in which the
execution of your custom code can result in an infinite loop. This leads to unnecessary execution of
plugins and can potentially impact the performance of CRM, as well as the user experience. In this
post, we will take a look at the Depth property of the IPluginExecutionContext service object and see
how it can be used to eliminate the risk of infinite loops.

*
Before we see how to use the Depth property, let’s take a look at a scenario. Assume your CRM
implementation consists of the Contact entity and a custom entity called Member. The requirement
for the system is to keep data on the Contact and Member entities synchronised, so that the
following business rules apply:
1. When a Member is created, a corresponding Contact record is created (if one does not already
exist)

2. When certain details on the Member is updated, details on the corresponding Contact record must
also be updated

3. When certain details on the Contact record is updated, details on the corresponding Member
record must also be updated
You can see that this type of business logic will require a plugin to be registered on create of
Member, and on update of both Contact and Member. You will also notice that updating a Member
triggers an update of the Contact, which again triggers an update of the Member and so on.
Firstly, let’s see what happens if we deploy such a plugin without any consideration for handling
infinite loops. I have updated the “Full Name” field on the Member, which should try to update the
“Full Name” field on the Contact.

The CRM platform throws an error stating that it has identified an infinite loop. This usually happens
after the number of iterations reaches a maximum of 8. We can fix this by adding a depth check at
the start of our plugin code, just after we initialize each of the service objects.
IPluginExecutionContext context =
(IPluginExecutionContext)serviceProvider.GetService(typeof(IPluginExecutionContext));
IOrganizationServiceFactory factory =
(IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactor
y));
_sdk = factory.CreateOrganizationService(context.UserId);
ITracingService tracer =
(ITracingService)serviceProvider.GetService(typeof(ITracingService));

if (context.Depth > 1) { return; }


Notice that last line which checks if the plugin has run more than once, and if so, executes a return
statement to cancel out of the plugin. Now when we run the plugin, we shouldn’t run into an infinite
loop.
You must be careful when using the Depth property as there are more complex scenarios that you
may run into. For example, a data import may trigger a workflow to update the “Full Name” of a
Member, which in turn will execute our plugin. In this case, the Depth will be 3 at the first execution
of the plugin. If you left the code snippet above unchanged, the plugin logic will never get executed.

7. How do you avoid sql deadlock.

There are many things that you need to do to avoid deadlocks in SQL Server but none
of them gives 100% assurance that no dead lock will occur again so you need to know
how to handle deadlocks when they occur. You need to first know types of deadlocks,
their reasons and how to break a deadlock by making one of the process as victim.

Here are some tips on how to avoid deadlocking on your SQL Server:
• Ensure the database design is properly normalized.
• Have the application access server objects in the same order each time.
• During transactions, don’t allow any user input. Collect it before the transaction
begins.
• Avoid cursors.
• Keep transactions as short as possible. One way to help accomplish this is to reduce
the number of round trips between your application and SQL Server by using stored
procedures or keeping transactions with a single batch. Another way of reducing the
time a transaction takes to complete is to make sure you are not performing the same
reads over and over again. If your application does need to read the same data more
than once, cache it by storing it in a variable or an array, and then re-reading it from
there, not from SQL Server.
• Reduce lock time. Try to develop your application so that it grabs locks at the latest
possible time, and then releases them at the very earliest time.
• If appropriate, reduce lock escalation by using the ROWLOCK or PAGLOCK.
• Consider using the NOLOCK hint to prevent locking if the data being locked is not
modified often.
• If appropriate, use as low of an isolation level as possible for the user connection
running the transaction.
• Consider using bound connections.

8. if you delete a record from UI, what happens in database. can you bring the record back?

In Microsoft Dynamics CRM, deleting an entity by using the Web application or through SDK Web
service calls usually results in a "soft delete" where the entity is not immediately deleted from the
database. Instead, the entity is marked for deletion later. The platform marks the entity for deletion
by setting the entity's DeletionStateCode attribute to 2. Entities with
a DeletionStateCode attribute set to 2 are filtered out from all data views in the Web application and
are not accessible using the SDK.
These marked entities are physically deleted from the database by the Deletion Service. The Deletion
Service is an asynchronous operation that is based on a table
namedScaleGroupOrganizationMaintenanceJobs in the MSCRM_CONFIG database of Microsoft
Dynamics CRM. By default, the frequency of the Deletion Service job execution is set to once a day.
You can use the Scale Group Job Editor tool to change the execution frequency of the Deletion
Service. You can find the tool on the Web at http://code.msdn.microsoft.com/ScaleGroupJobEditor

9 what is deletion service? can you change its schedule

10. Difference between PlugIn vs Workflow (Asynchronous vs Synchronous)

 WF can be created by end user and non-developer while Plugin can only create by developer
(S/W Engineer).
 WF do not execute when offline while Plugin execute in both state (Offline and Online).
 Wait condition only in WF not in plugin.
 WF can run on demand while plugin need something to trigger.
 Limited trigger point (CAUD, change state) while Plugin have 100s of messages to trigger.

11. for plugin deployment, Difference between GAC, DataBase, Disk deployments.
GAC Deployment

 Plugin assembly registered in GAC


 Plugins do not backed up with database
 Plugins cannot be added to the solution
 Plugins needs IISRESET to refresh
 Does not support Dynamics CRM online
 You can refer external DLL assemblies used in Plugin only if they are registered in GAC
DB Deployment

 Plugin uploaded into the database


 Plugins backed up with database
 Plugins can be added to the solution
 Plugins do not need IISRESET to refresh
 Supports Dynamics CRM online deployment
 You can refer external DLL assemblies used in Plugin only if they are registered in GAC
Disk deployments

 Plugin assembly saved on CRM server hard disk


 Plugins do not backed up with database
 Plugins cannot be added to the solution
 Plugins needs IISRESET to refresh
 Does not support Dynamics CRM online
 You can refer external DLL assemblies from the disk and from GAC
Note:
 With ILMerge external referenced assemblies can be merged together to deploy as a single plugin
assemly. This will remove the restriction with Dynamics CRM online deployments, but large
assemblies are slow to load.
Misconception:
 You need to deploy plugin dll on the CRM server to enable remote debugging, but this is not required
for database deployment, you will need to put pdb file in C:\Program Files\Microsoft Dynamics
CRM\Server\bin\assembly folder on crm server.
Benefits of Database Deployment
 Only database assemblies can be packaged in solutions
 Zero service interruption to update a database assembly
 Simplified organization backup / import.
 Disk assemblies will not support multiple versions
 All assemblies consolidated into a single place
 Sandbox and CRM Online only support database assemblies

12. Difference between CRM webservice Vs CRM.SDKProxy namespaces.

it is used to access Entittie and attributes at runtime, it uses DynamicEntity class,


which provides a property bag to access the attributes of an entity instance (record).
This is preferred because the entity classes included in this DLL will not contain any of
your customizations. The entity classes are deprecated and will be removed from this
assembly in a future version.
13. What are different operation (Pre Validation, Preoperation & Post operation) of Plugin ?

Pre validation means you plugin will run before the form is validated

Pre -operation is after validation and before the values are saved to the database

Post operation is your plugin will run after the values have been inserted/changed on
the database

14. Difference between Secure & Unsecure Config?

Secure Configuration:
The Secure Configuration information could be read only by CRM Administrators.(Eg:
Restricted data from normal user could be supplied here)

Unsecure Configuration:
Unsecure configuration information could be read by any user in CRM. Remember its
public information (Eg: Parameter strings to be used in plugin could be supplied here).

Unsecure Configuration of Secure Configuration of Plugin


Plugin Registration tool in CRM 2011 Registration tool in CRM 2011
Unsecure configuration information could be read by any user The Secure Configuration information could be read only by
in CRM. Remember its public information (Eg: Parameter CRM Administrators.(Eg: Restricted data from normal
strings to be used in plugin could be supplied here) user could be supplied here)
Imagine that you include a plugin,plugin steps and activate
Imagine that you include a plugin, plugin steps and activate
them in asolution. Later solution was exportedas Managed
them in a solution. Later solution was exported as Managed
Solution to anotherenvironment. In this scenario, thesupplied
Solution to another environment. In this scenario, the supplied
Secure configuration information would NOTbe available in
Unsecure configuration values would be available in the new
the new environment. The simple reason behind this is to
environment.
provide more security to the contents of Secure Configuration.
Note: If you supply parameter strings under secure configuration then the plugin will work fine only for the CRMIf
you supply any parameter strings to Plugin and read by all of the users in CRM , use Unsecure Configuration.

15. When we should go with Early binding and when with Late Binding?

16. Can we pass data between two Plugins?

See save web page

17. Can we register On premise plugin in Sandbox mode?

yes

18. Different modes of plugin?

19. Why we need to Create Security Key before registered the plugin?

20. What interface we use in plugin to inherit CRM Services?


21.Importance of Secondary Entity in plugin registration tool?

22. What security roles needs to register the plugin in Online and on premise both?

23. What is filtering Attribute in CRM Plugin Reg Tool?

24. What is Tracing Service in Plugin ?

25. What is Target Entity, Input and Output Parameter in Plugin?

26. Difference between Service.Retrieve and Service.RetriveMultiple

27. What are different ways (QueryExpression, LINQ, FetchXML) to fetch CRM metadata in Plugin.
Differrnece between them?

28. What is the Execution Time of Sync and Async plugin in crm?

29. Which will execute first in Aync Workflow and Async Plugin?

30. How can we call external webservice in onpremise and Online plugin in crm?

31. What are the different ways available to debug a Plugin (Onprem and Online both)

32. Best Practices of CRM Plugin Developemnt (https://msdn.microsoft.com/en-


us/library/gg509027.aspx).

When to Use Plug-ins


inShare

Plug-ins can be used to achieve some of the similar goals as with workflows or client-
side code such as JavaScript, Silverlight, or HTML.

Plug-in vs. Client-side Code


The differentiation is clear. Plug-in runs server-side with compiled code and should
always be the preferred method of implementing business logic. Client-side code is
vulnerable to different client environment, browsers, browser settings, etc, and should
not be relied on implementing business critical steps.

On the other hand, anything requiring UI or user interaction, must be done with client
side code. You will not be able to modify UI or prompt the user during processing with
the plug-in.
Plug-in vs. Processes
These are very similar, in fact workflows are just a skin on an asynchronous system
plug-in. The main differences:

 Workflows can only be triggered asynchronously

 Workflows can only be triggered online

 Workflows have limited triggers. Mostly these would be your basic


create/update/delete/assign/state change.

 Plugins support different event execution pipelines. Workflows are always post operation.

 Workflow execution logic can be easily modified, this allows encapsulation of code in
custom workflow activity while still retaining possibility of frequent changes on execution
logic by non-programmers.

TIP: While migrating data, it is a good practice to evaluate the effects of active plugins
and workflow extensions. Sometimes it might be desirable to turn off the plugins and
workflow extensions.
Synchronous vs. Asynchronous Plug-ins
Synchronous plug-ins are executed by the CRM Core System. Synchronous execution
means that triggering event will wait until the plug-in finishes the execution. For
example, if we have synchronous plug-in that triggers on the creation of account and
user creates account record in CRM, the form will hang at save until the plugin has
finished.

Asynchronous plug-ins are executed by asynchronous service. Asynchronous plug-ins


allow triggering event to finish before plug-in code runs. Therefore these can never be
used to prevent an action, validate data entry, or provide any error messages back to
the user.

Plugin Interview Questions:

What is the use of Secondary Entity within Plugin Registration Tool in MSCRM 2011?

Secondary Entity use when you have to retrieve record from Intersect Entity (contactleads) having
records of Entities (Contact and Lead) having N: N Relationship.

When is ‘Secondary Entity’ required?

The following 2 messages require the ‘Secondary Entity’ to be specified while registering a step in Plugin
registration: a) SetRelated b) RemoveRelated
What does ‘SetRelated’ and ‘RemovedRelated’ do

These two messages are basically triggered when a primary entity record is associated/dissociated
with/from the secondary entity record via the relationships supported. So, if you’re planning to execute
some business logic on association of the specific entities, you can register the plugin against the
‘SetRelated’ message. The ‘RemoveRelated’ works for dissociation of the entity records from each other.

1. Explain in details about the event execution pipeline.

The event execution pipeline allows you to configure when in the event the plug-in code will execute.
The event pipeline is Pre-event (Pre-Validation, Pre-Operation), Post-event (post-operation). Before or
after save.

2. when do we register a plugin in child pipeline? give examples

This use only in CRM 4.0. There are limitations that vary with stage and execution mode.

3. What are images. Why are they used.

The pre/post images return the data as it is stored in the CRM database. One scenario where the pre-
image can be useful is during an Update event when you need to get a value whether or not it was
updated (since only updated fields are available in the input). Post-image can be used to see the final
value after all of the business logic has run (example the Quote ID generated OnSave).

____________________________________________________________________________________

One of the best uses for this is in update plug-ins. As mentioned before, update plug-in target entity only
contains the updated attributes. However, often the plug-in will require information from other
attributes as well. Instead of issuing a retrieve, the best practice is to push the required data in an image
instead.

Comparison of data before and after. This allows for various audit-type plugins, that logs what the value
was before and after, or calculating the time spent in a stage or status.

4. What is early binding and late binding. How is it used in CRM?

Code snippet 1 (Late binding) :


Entity e =new Entity();
e.LogicalName = "account";
e.Attributes["new_firstname"] = "data";
_serviceProxy.Create(e);

Code snippet 2 (Early binding) :


Account account = new Account { FirstName = "data" };
_serviceProxy.Create(account);

early binding is practically a wrapper around to the standard classes to speed up the development.
It has also some bonus like the possibility to use LINQ.
You can always choose both, there are no limitations. Personally I prefer late bound, especially for
plugin development.
late bound is faster than early bound, but if your application doesn't require speed performances this is
not the main criteria to choose between late bound and early bound.

Early Binding

Advantage:

In Microsoft Dynamics CRM 2013 /2011 Software Development Kit contains with a tool (CrmSvcUtil)
which can automatically generate helper classes to make it easier to work with your CRM entities and
their attributes. You can also generate helper class from MS Visual Studio (greater than 2010 version) if
you install CRM SDK Developer tool kit package and connect to CRM organization then generate
wrapper class. This provides type checking at compile time, which eliminates the chance of running into
InvalidCastExceptions during execution of your custom code. It also lets developers take advantage of
intelligence by suggesting names for entities, attributes, and relationships. This can speed up
development time by removing the risk of spelling mistakes.

Disadvantage

Every time you make a customization change in your system, you will need to run the CrmSvcUtil tool
again to ensure that the latest entities, attributes, and relationships are available in your custom
applications. The size of the generated file can be large depending on the complexity of your system.
Use of the Helper class results in slightly lower performance than the Late-bound entity types.

Late Binding

Advantage

Late binding involves the use of the generic “Entity” class which can manage objects of any entity type.
For example, we can use the “Entity” object to programmatically create Accounts, Contacts, Leads, or
any custom entity. So in this case we have to define everything explicitly, so here no need to generate
helper class again and again. Use of the Entity class results in slightly better performance than the early-
bound entity types.

Disadvantage

Type checking is performed at runtime, so developers must explicitly cast attribute values correctly
otherwise the custom code will fail during execution. Developers need to be familiar with the late
binding syntax as there is no intelligence available.

5. How do you debug a plugin


_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________
_____________________________________________________________________________________

6. when can infinite loop occur in a plugin. How do you avoid infinite loops in plugin code.

When developing plugins for Microsoft Dynamics CRM 2011, there are scenarios in which the execution
of your custom code can result in an infinite loop. This leads to unnecessary execution of plugins and can
potentially impact the performance of CRM, as well as the user experience.

______________________________________________________________________________

An infinite plugin loop example is: You have a post-update plugin on an entity 'A' that updates
something in entity 'B' and entity 'B' has a post update plugin that updates plugin 'A'. Or You have a
post-update plugin on an entity 'A' that updates a field in the same entity 'A', when entity 'A' will be
updated, it will result in another update of entity 'A' and this will go on and will result in infinite loop.
Now, let’s come to 'How we can stop it from happening?' There is a property called Depth for Context
object. You can use this property to check if you are heading to an infinite loop. If context.Depth > 1,
then you have a case of plugin causing a call to itself. The Depth attribute increments each time a plugin
causes another plugin to execute. So you could check the contact plugin context. Depth is not larger
than 2 if you want it to still fire at least once from the account plugin.

Every time a running plug-in or Workflow issues a message request to the Web services that triggers
another plug-in or Workflow to execute, the Depth property of the execution context is increased. If the
depth property increments to its maximum value within the configured time limit, the platform
considers this behavior an infinite loop and further plug-in or Workflow execution is aborted. The
maximum depth (8) and time limit (one hour) are configurable by the Microsoft Dynamics CRM
administrator.

You must be careful when using the Depth property as there are more complex scenarios that you may
run into. For example, a data import may trigger a workflow to update the “Full Name” of a Member,
which in turn will execute our plugin. In this case, the Depth will be 3 at the first execution of the plugin.
If you left the code snippet above unchanged, the plugin logic will never get executed.

7. How do you avoid sql deadlock.

There are many things that you need to do to avoid deadlocks in SQL Server but none of them gives
100% assurance that no dead lock will occur again so you need to know how to handle deadlocks when
they occur. You need to first know types of deadlocks, their reasons and how to break a deadlock by
making one of the process as victim.

Here are some tips on how to avoid deadlocking on your SQL Server:

• Ensure the database design is properly normalized.


• Have the application access server objects in the same order each time.
• During transactions, don’t allow any user input. Collect it before the transaction begins.
• Avoid cursors.
• Keep transactions as short as possible. One way to help accomplish this is to reduce the number of
round trips between your application and SQL Server by using stored procedures or keeping transactions
with a single batch.

Another way of reducing the time a transaction takes to complete is to make sure you are not
performing the same reads over and over again. If your application does need to read the same data
more than once, cache it by storing it in a variable or an array, and then re-reading it from there, not
from SQL Server.
• Reduce lock time. Try to develop your application so that it grabs locks at the latest possible time, and
then releases them at the very earliest time.
• If appropriate, reduce lock escalation by using the ROWLOCK or PAGLOCK.
• Consider using the NOLOCK hint to prevent locking if the data being locked is not modified often.
• If appropriate, use as low of an isolation level as possible for the user connection running the
transaction.
• Consider using bound connections.

8. if you delete a record from UI, what happens in database. can you bring the record back?
In Microsoft Dynamics CRM, deleting an entity by using the Web application or through SDK Web service
calls usually results in a "soft delete" where the entity is not immediately deleted from the database.
Instead, the entity is marked for deletion later. The platform marks the entity for deletion by setting the
entity's DeletionStateCode attribute to 2. Entities with a DeletionStateCode attribute set to 2 are filtered
out from all data views in the Web application and are not accessible using the SDK.
These marked entities are physically deleted from the database by the Deletion Service. The Deletion
Service is an asynchronous operation that is based on a table
namedScaleGroupOrganizationMaintenanceJobs in the MSCRM_CONFIG database of Microsoft
Dynamics CRM. By default, the frequency of the Deletion Service job execution is set to once a day. You
can use the Scale Group Job Editor tool to change the execution frequency of the Deletion Service. You
can find the tool on the Web at http://code.msdn.microsoft.com/ScaleGroupJobEditor

9 what is deletion service? can you change its schedule


10. Difference between PlugIn Vs Workflow (Asynchronous vs Synchronous)

11. for plugin deployment, Difference between GAC, DataBase, Disk deployments.

GAC Deployment

Plugin assembly registered in GAC


Plugins do not back up with database
Plugins cannot be added to the solution
Plugins needs IISRESET to refresh
Does not support Dynamics CRM online
You can refer external DLL assemblies used in Plugin only if they are registered in GAC
DB Deployment

Plugin uploaded into the database


Plugins backed up with database
Plugins can be added to the solution
Plugins do not need IISRESET to refresh
Supports Dynamics CRM online deployment
You can refer external DLL assemblies used in Plugin only if they are registered in GAC
Disk Deployments

Plugin assembly saved on CRM server hard disk


Plugins do not back up with database
Plugins cannot be added to the solution
Plugins needs IISRESET to refresh
Does not support Dynamics CRM online
You can refer external DLL assemblies from the disk and from GAC

Note:

With ILMerge external referenced assemblies can be merged together to deploy as a single plugin
assemly. This will remove the restriction with Dynamics CRM online deployments, but large assemblies
are slow to load.
Misconception:

You need to deploy plugin dll on the CRM server to enable remote debugging, but this is not required for
database deployment, you will need to put pdb file in C:\Program Files\Microsoft Dynamics
CRM\Server\bin\assembly folder on crm server.

Benefits of Database Deployment

Only database assemblies can be packaged in solutions


Zero service interruption to update a database assembly
Simplified organization backup / import.
Disk assemblies will not support multiple versions
All assemblies consolidated into a single place
Sandbox and CRM Online only support database assemblies.

12. Difference between CRM webservice Vs CRM.SDKProxy namespaces.

It is used to access Entities and attributes at runtime, it uses DynamicEntity class, which provides a
property bag to access the attributes of an entity instance (record). This is preferred because the entity
classes included in this DLL will not contain any of your customizations. The entity classes are
deprecated and will be removed from this assembly in a future version.

13. What are different operation (Pre-Validation, Pre-operation & Post-operation) of Plugin?

Pre validation means you plugin will run before the form is validated
Pre -operation is after validation and before the values are saved to the database
Post operation is your plugin will run after the values have been inserted/changed on the database

14. Difference between Secure & Unsecure Config?

Unsecure Configuration of Secure Configuration of Plugin

Plugin Registration tool in CRM 2011 Registration tool in CRM 2011

Unsecure configuration information could be read The Secure Configuration information could
by any user in CRM. Remember be read only by CRM Administrators. (E.g.:
its public information (E.g.: Parameter strings to Restricted data from normal user could be
be used in plugin could be supplied here) supplied here)

Imagine that you include a plugin, plugin steps and Imagine that you include a plugin, plugin steps and
activate them in a solution. Later solution was activate them in a solution. Later solution was
exported as Managed Solution to another exported as Managed Solution to another
environment. In this scenario, the supplied environment. In this scenario, the supplied Secure
Unsecure configuration values would be available configuration information would NOT be
in the new environment. available in the new environment. The
simple reason behind this is to provide more
security to the contents of Secure Configuration.

Note: If you supply parameter strings under secure configuration then the plugin will work fine only for
the CRM. If you supply any parameter strings to Plugin and read by all of the users in CRM, use Unsecure
Configuration.

15. Can we pass data between two Plugins?

Yes

16. Can we register On premise plugin in Sandbox mode?

Yes

17. Different modes of plugin?

18. Why we need to Create Security Key before registered the plugin?

19. What interface we use in plugin to inherit CRM Services?

21. Importance of Secondary Entity in plugin registration tool?


22. What security roles needs to register the plugin in Online and on premise both?

23. What is filtering Attribute in CRM Plugin Reg Tool?

24. What is Tracing Service in Plugin ?

25. What is Target Entity, Input and Output Parameter in Plugin?

26. Difference between Service.Retrieve and Service.RetriveMultiple

27. What are different ways (QueryExpression, LINQ, FetchXML) to fetch CRM metadata in Plugin.
Differrnece between them?
28. What is the Execution Time of Sync and Async plugin in crm?

29. Which will execute first in Aync Workflow and Async Plugin?

30. How can we call external webservice in onpremise and Online plugin in crm?

31. What are the different ways available to debug a Plugin (Onprem and Online both)

32. When to Use Plug-ins

Plug-ins can be used to achieve some of the similar goals as with workflows or client-side code such as
JavaScript, Silverlight, or HTML.

Plug-in vs. Client-side Code

The differentiation is clear. Plug-in runs server-side with compiled code and should always be the
preferred method of implementing business logic. Client-side code is vulnerable to different client
environment, browsers, browser settings, etc., and should not be relied on implementing business
critical steps.

On the other hand, anything requiring UI or user interaction, must be done with client side code. You
will not be able to modify UI or prompt the user during processing with the plug-in.

Plug-in vs. Processes

These are very similar, in fact workflows are just a skin on an asynchronous system plug-in. The main
differences:
Workflows can only be triggered asynchronously
Workflows can only be triggered online
Workflows have limited triggers. Mostly these would be your basic create/update/delete/assign/state
change.

Plugins support different event execution pipelines. Workflows are always post operation.
Workflow execution logic can be easily modified; this allows encapsulation of code in custom workflow
activity while still retaining possibility of frequent changes on execution logic by non-programmers.

TIP: While migrating data, it is a good practice to evaluate the effects of active plugins and workflow
extensions. Sometimes it might be desirable to turn off the plugins and workflow extensions.

Synchronous vs. Asynchronous Plug-ins

Synchronous plug-ins are executed by the CRM Core System. Synchronous execution means that
triggering event will wait until the plug-in finishes the execution. For example, if we have synchronous
plug-in that triggers on the creation of account and user creates account record in CRM, the form will
hang at save until the plugin has finished.

Asynchronous plug-ins are executed by asynchronous service. Asynchronous plug-ins allow triggering
event to finish before plug-in code runs. Therefore, these can never be used to prevent an action,
validate data entry, or provide any error messages back to the user.

What is CRM

CRM is as a strategic process that will help you better understand your customers’ needs and how you
can meet those needs and enhance your bottom line at the same time. This strategy depends on
bringing together lots of pieces of information about customers and market trends so you can sell and
market your products and services more effectively.

What is Dynamics CRM

Microsoft Dynamics CRM is a business app that helps you track all your customer interactions and data.
It is a solution that drives sales productivity and marketing effectiveness through social insights,
business intelligence and campaign management in the cloud, on-premises or with a hybrid
combination.

How to Evaluate CRM

• Scalable

• Ease of Use

• Simplified Workflow
• Customization

• Integration

-------------------\\\

Causes Of Failure Of CRM

• Narrow Vision

• Don’t have well defined objectives

• Employees are not prepared for changes

• Avoid to use Top-Bottom change

• Improper Integration

Microsoft Dynamics CRM Sales Module includes:

 Opportunity Management
 Sales process management
 Pipeline optimization
 Quotes
 Order management
 Sales force management
 Sales literature
 Direct Email

• An opportunity represents a potential sale. If a price list is selected


for an opportunity, one or more products can be added and the
system will automatically calculate pricing based on the selected
price list.
• A quote can be generated based on a saved opportunity. The quote is
created automatically and will inherit all of the products and pricing
from the opportunity record. A quote can then be presented to a
customer.
• If the customer agrees to purchase, an order can be created. The
order will automatically inherit all of the information contained in
the quote.
• Finally, an invoice can be generated directly from the information
contained within the order. Similar to the other steps in the sales
process, the invoice will reflect the information contained within the
order.

Microsoft Dynamics CRM Customer Service Module includes:


 Case Management
 Complete 360-degree view of customer information
 Automated routing and queuing
 Auto-response
 Email
 Email management
 Service scheduling
 Searchable knowledge base
 Service contracts

Microsoft Dynamics CRM Marketing Module includes:

 Campaign Management
 Marketing list management
 List segmentation
 Campaign execution
 Marketing reporting (track marketing information from response through the sales cycle)

Add strategic campaign information to your campaign, such as:

 Budgets and expenses

 Promotion codes

 Target products

 Marketing collateral, including sales literature

 Target marketing lists

 actual start and end dates of the campaign.

Microsoft Dynamics CRM


Customer Relationship Management/Sales Force Automation Software
Microsoft Dynamics CRM is a full customer relationship management suite with marketing,
sales, and customer service capabilities that is:
 Flexible, with options for deployment, purchase, and access.
 Familiar and easy to use because it works like other Microsoft products such as
Outlook.
 Designed to fit your business through extensive customization and partner offerings.
Find a Microsoft Dynamics CRM Partner

Microsoft Dynamics CRM Add On Products – There is a network of hundreds of


companies that provide Add On/ISV applications to enhance the functionality of Microsoft
Dynamics CRM. Find Microsoft Dynamics CRM Add On Providers.

Microsoft Dynamics CRM Capabilities Overview


Sales
Microsoft Dynamics CRM for Sales PDF
Sales by Microsoft Dynamics provides a complete and intuitive solution that can help
salespeople be more productive so they can focus on what's most important—delivering
amazing customer experiences.
 Opportunity Management
 Social Selling
 Planning and Management
 Content Collaboration
 Mobile Sales
 Sales Intelligence

Service

Microsoft Dynamics CRM for Service PDF


Service by Microsoft Dynamics empowers customers through their choice of self and
assisted service options; empowers agents to deliver fast, informed and effective
resolutions; and seamlessly incorporates field solutions when there is a need for onsite
help. Our agile solutions easily adapt to changing demands so that your business can
deliver intent driven outcomes in a secure, flexible and reliable environment.
 Omni-channel
 Self-service
 Agent enablement
 Field service
 Knowledge
 Service intelligence

Marketing
Microsoft Dynamics CRM for Marketing PDF
Microsoft Dynamics Marketing is an integrated marketing resource management solution for
marketing operation, planning, execution, and analytics across all channels—email, digital,
social, SMS, and traditional.
 Marketing resource management
 Multichannel campaigns
 Lead management
 Sales collaboration
 Social marketing
 Marketing intelligence

Social

Microsoft Dynamics CRM for Social PDF


Microsoft Dynamics Marketing is an integrated marketing resource management solution for
marketing operation, planning, execution, and analytics across all channels—email, digital,
social, SMS, and traditional.
 Social listening
 Social analytics
 Social engagement
 Social CRM

What’s new in MS Dynamic CRM 2013:


Entity images: Set am image for Entity.

Access teams: new type of team. Not the owner of that record but access records. Create any number
of access team to work on same record and also team members have different level of access right to
the record.

Business process flow: new type of the process (workflow) for creating visualizations to guide users
through various phases of business processes.

Real-time workflows: real-time (synchronous) workflows. Real-time workflows are not queued, but execute
immediately on-demand. Perform similar functionality to plug-ins, yet can be created by the end user through
the web application workflow designer. Developers can create real-time workflow through code. In addition,
real-time workflows provide the core processing functionality of actions.

1- What are the different webservices available in MS CRM 2011?


There are 2 webservies available in MS CRM 2011, IOrganization service and IDiscovery service.
IOrganization service is use to fetch data and metadata from MS CRM, while IDiscovery service is
use to determine your organization and endpoints for IOrganization service to access MS CRM
data.
2- Which service can be used to access metadata information?
Webservice is used to access metadata information.
3- What is Metadata?
All information necessary for MS CRM server to operate is stored in MS CRM metadata. This
include information about entities, relationships, option sets, attributes.
4- What is Endpoints?

https://msdn.microsoft.com/en-us/library/gg490659.aspx
Name endpoint comes from Enterprise Integration Patterns. You can work with CRM
through user interface it provides for you, but there is other option. Your own
software is able to interact with CRM, as with service. Interaction goes through the
messages, your client software sends to CRM services. So, in this case both,
software you are working on and CRM will have endpoints. Your software will have
client endpoints, but CRM will have server endpoints. I don't think you need to add
new endpoints in CRM, because there are already defined. Just use them sending
messages from your code.
5- Difference between Dialog and Workflow.
 Dialog: are synchronize, must be run my user, while Workflow are both synchronize and
asynchronize. Run automatically and by the user.
 Triggers are supported for workflow while in dialog they aren’t.
 Workflow can be created or updates through outside the CRM using XAML while in
dialog they aren’t.
6- What is solution and Difference between Managed and unmanaged solution?
Solution are how customizers and developers author, package and maintain unit of software
that extend CRM. Customizers and developers distribute solution so that organization can used
CRM to install and uninstall the business functionality define by solution.
Managed Solution: are solution cannot be modify.
Unmanaged Solution: are solution that can be modify but can’t be uninstall.
7- What is field level security?
Field level security to restrict access of high business impact fields to specific users.
8- How can we create a custom Ribbon button? By using XML.
<button id=”Create_id” label=”GO” OnAction=”DO_IT” screentip=”Screen Class”
supertip=”Super Class” />
9- What is sandbox plugin?

Sandbox is recommend execution environment for Plug-ins as it is more secure, support


runtime monitoring, statistics reporting and is supported in all CRM deployments.

Sandbox can make use of full power of crm sdk to access organization web service. Access to file
system, system event log, certain network protocols, registry.

10- What is SQL Views?


In SQL, a view is a virtual table based on the result-set of an SQL statement.
A view contains rows and columns, just like a real table. The fields in a view are fields
from one or more real tables in the database. By using view you can do the following:
 Restrict a user to specific rows in a table.
 Restrict a user to specific columns.
 Join columns from multiple tables so that they look like a single table.
 Aggregate information instead of supplying details.
11- What is SQL triggers?

A trigger is a special kind of stored procedure that automatically executes when


an event occurs in the database server. DML triggers execute when a user tries
to modify data through a data manipulation language (DML) event. DML events
are INSERT, UPDATE, or DELETE statements on a table or view.

12- What are SQL Constraint, Rule, and Default?

13-
1. What is the use of String Map Table in MSCRM?

String map table basically used in MSCRM for storing the details of Option Set Fields exists in an
organization. It contains all the data (Attribute Name, Option Set name, option value, option name,
Object Type Code) of option set.

select INC.TicketNumber[Case ID],SMT.Value[Status Name], SMT.AttributeValue[Status Value]


from incident as INC inner join StringMapBase as SMT
on INC.StatusCode = SMT.AttributeValue
where SMT.AttributeName='statuscode' and SMT.ObjectTypeCode=112

2. Difference between Asynchronous Plugin and Workflow?

Requirement
Use Plug-in Use Workflow

Needs a synchronous
action to happen before or
No
after an event occurs

Or
Yes
Need to perform a task
that has to completed
within 2 Sec

The logic needs to be Yes No


executed while offline

Needs elevation of
privileges (impersonation)

Or
No
Perform data operations on
Yes
behalf of another system
user

Needs to execute on events


other than assign, create,
Yes No
update, set state

The process/logic may take


a long time to complete or
will be a persistent process No Yes
(multiple long running
steps)

End users will need to No Yes


modify the process logic

Child
sub processes will be
No Yes
triggered

3. Tell me types of Entity and What are Organization Type in Entity?

Entities form a vital piece of the Microsoft Dynamics CRM framework. Essentially, entities are used to
model and manage business data. Some common entities that most Dynamics CRM users are familiar
with are Account, Case, Campaign, Contact, Lead, and Opportunity. These entities deal with many of the
most common sales, service, and marketing data with which a CRM user frequently engages.

Types of Entity in MSCRM

There are three main types of entities: system, business, and custom. In Dynamics CRM, system entities
handle internal processes such as workflows. It is important to note that system entities cannot be
deleted or customized. Business entities are the default entities within Dynamics CRM which include
Case, Account, and Opportunity. One of the most important elements in Microsoft Dynamics CRM
is customization. Custom entities provide organizations with a way to meet their needs head-on. One
example of this is that you can create a vendor entity if you are a retail business and then dictate how it
relates to different entities within your organization. Since each entity supports a variety of actions,
streamlining communications processes amongst your organization is now an attainable goal.

Entities Ownership – Microsoft Dynamics CRM


Ownership is a key factor in how entities work. In Microsoft Dynamics CRM, most entities have an
owner, which is determined by the ownership type. There are four ownership types in CRM:
organization, business, user, and none. Organization-owned entities can be accessed by an entire
organization. These records cannot be assigned to an individual owner (or shared). Business-owned
entities belong to a Business Unit, while user-owned entities are owned by one specific CRM user and
typically contain customer-related data. Accounts, Contacts, and Cases are examples of user-owned
entities. A few entities in Dynamics CRM have no ownership type. They are not owned by another entity
(user, business unit, or organization) within CRM.

The following table lists the complete ownership types:

Ownership Description
Type

Organization Organization-owned entities typically contain data involving something that


Owned belongs to or that can be viewed by the whole organization. Organization-
owned entities cannot be assigned or shared. For example, products are
owned by the organization.

Business Business-owned entities belong to a business unit.


Owned

User Owned User-owned entities are associated with a user. User-owned entities typically
contain data that relates to customers, such as accounts or contacts. Security
can be defined according the business unit for the user.

None The entity is not owned by another entity. For example, the uom (unit-of-
measure) and workflowlog (workflow log) entities are not owned by another
entity.

How to retrieve records from Entity having N:N Relationship ?


When we create N: N relationship between 2 entities, it creates an intermediate entity (i.e.,
Relationship Entity).

How many types of Relationships and Relationship Behavior exist in MSCRM?

In Microsoft Dynamics CRM you can create different types of relationships. Below are the
relationships that can be created:

1. 1:N
2. N:1
3. N:N
In a relationship you can configure relationship behaviors. Below are the different relationship
behaviors that can be configured in CRM:

1. Parental
In parental relationship, any action taken on the parent record is also taken on the child entity
record. For example if the parent record is shared with a user, all the child records will also be
shared with the same user.
2. Referential
In a referential relationship, the action taken on the parent entity record will not impact the child
entity record
3. Referential, Restrict Delete
In a referential, restrict delete relationship, the action taken on the parent record will not impact
the child entity record but you cannot delete the parent record until the parent record exists
4. Configurable Cascading
Configurable cascading allows the user to choose the behavior they want to be apply. Below are
the behaviors that can be configured:

 Cascade All – This behavior performs an action on all the related child records. For example, if
my opportunity is assigned to an another user then all the child records should be assigned to
the same user
 Cascade None – This behavior performs no action on the child records
 Cascade Active – This behavior performs action only on the active records
 Cascade User- owned – This behavior performs action on the child records which are owned
by the same user as parent
 Remove Link – This behavior only removes the link for the child record without modifying
anything on the record.
Have you ever faced Performance related issue in MSCRM, How you have
resolved it?

 Optimize Your Form Load Experience.


 Keep less fields on the form.
 Do not overuse scripts (Avoid OnLoad; Use OnChange since its on demand).
 Trim the ribbon appropriately.
 Be wary of client side enabled rules.
 Use collapsed sections whenever possible.
 Use server side show/hide fields.
 Use ‘read optimized’ forms.
 Use iFrames carefully, the more you have longer it takes to load.
 Use Sub-grids, where necessary as it tend to increase page size quickly.
 Manage the complexity and visualizations of dashboards.
Other than customizations,
 Make sure you meet the minimum requirements for Hardware
 Power settings can affect performance
 Proxy server settings
 Configure Internet Explorer for optimal performance: Configuring client-side browser
caching and Configuring simultaneous download sessions
 Extraneous processes, applications, and add-ins
 Internet Explorer zoom setting

What is difference between FIND and ADVANCED FIND in MSCRM ? Which is


Faster ?
Find : Find perform a search on an attribute for which it is defined.
Advanced Find : Advanced Find perform search on the conditions and the
attributes for which user customizes or runs it.

Find : Normal Find is faster as it looks for one attribute and matches with that and
returns the result
Advanced Find: Advanced Find searches for all the attributes and conditions
while parsing through the records.
Find : Find is applicable on only active records and it finds only on 2 or 3 column
which we have defined in the find view and even it returns any those column
which is there in the view
Advanced Find : Advanced find is applicable to all the records and it finds all the
columns and even it returns all the column and filter criteria can be on any column
and most important

Find : Find filters on just one condition


Advanced Find : But adv find filters on multiple condition at one time..

So Find is faster than Advanced Find.

Where Plug-In store in MSCRM or Where the Plug-In information stored in


MSCRM ?

One of my colleagues faced a situation where he had installed a plugin assembly into
database but was not able to locate its DLL, and now he wanted to deploy it in some other
server.

In MSCRM all plugins related information like its name, content, createdBy, createdOn.
ModifiedBy, ModifiedOn etc store in PluginAssemblybase Table. You can get it by below
Query result :
select * from PluginAssemblyBase
Below are some column description of PluginBaseTable :

Column Description
Name
Name Store name of Plugin
Source Type Where the Plugin registered
0 - Database
1 - Disk
2 - GAC
content Store content of DLL

These are the steps to get DLL from Content :

Get the encoded base 64 string representation of the plugin from PluginAssemblyBase table.

select name,content,*
from PluginAssemblyBase

Use that content and get the dll from the following site.

http://www.motobit.com/util/base64-decoder-encoder.asp

Set decode and export to binary file option there with filename having extension as .dll
Open the dll in the reflector tool and use the source code to build that assembly.

http://reflector.red-gate.com/download.aspx

How many possible ways to registered a Plug-In in MSCRM ?

Answer : 1. Plugin Registration Tool. 2. Solution Export/Import 3.Developer Tool Kit

What is SCOPE in MSCRM system workflow and why it is use for ?

Answer : In MSCRM workflow has 4 Scope available as mentioned below


:
1. User - WF will only run for those record whose owner is WF owner itself or Logged in
User only.

2. Business Unit: WF will only run for those record whose owner is in the same BU of WF
owner.

3. Parent-Child Business Unit: WF will only run for those record whose owner is in the Child
BU of WF owner BU

4. Organisation : WF will run for all records in organisation regardless of owner

What is the difference in fields in User or Team owned Entity and


Organisation Owned Entity ?

Answer : There is no 'Owner' field available on the form when you create a Entity
has Organisation Ownership. while in User or Team Owned Entity this field will be
available.
Below is the screenshots which will clear what exactly happens:

Organisation owned Entity Fields (No Owner field exists) :


User or Team owned Entity Fields :
Can System Admin Create, Update, Delete the Personnel View of other User ?

Answer : NO,
In MSCRM, each user has User Access Level on Saved Views(Personnel View), even System
Admin cannot do any operation on Personnel View see below:

Why MSCRM ? Since so many CRM available in the market like ERP, SAP,
SIEBEL etc But How MSCRM is different from others ?

Answer : World-class customer experiences begin with your people. By giving your people the
right tools to multiply their productivity, multiply their impact, they can drive your organisation
to achieve your goals, multiply your revenue, and multiply your customers.

The top reasons, why organisations choose Microsoft Dynamics CRM instead of other CRM to
create world-class customer:

Ease of Use :
Since MSCRM is a Microsoft product which is very similar & integrated with other
Microsoft Products Like MS Word, MS Excel, MS Outlook, MS SharePoint, Internet
Explorer etc, so it is very familiar to all those businessman who use to spend 70% of his time
on these tools, To understand this CRM no additional tool need to be learn, no additional
software need to be install. Anyone could easily learn MSCRM with little training.
In other words we can also say that

it integrates with Microsoft Business Solutions for Financial Management, Microsoft Office, and
other systems to that you get a complete picture of your customer.

It's important to note just how easy it is to integrate Microsoft CRM with Microsoft Office.
Because it is so easy it enables your employees to access Microsoft Dynamics CRM right from
their Microsoft Office Outlook whether they are working online or offline. It's a great tool for
your sales department and it takes little training to make it happen.
Dynamic :
Since MSCRM hide Dynamic word inside itself its abbreviate as 'Microsoft Dynamic
CRM'. We can extend it at any level. Microsoft itself provides three modules (Sales, Marketing
& Service). But anyone could add its own module. Apart from this MSCRM is easy integrated
with other MS Products as well as various third party tool like Ava-ya etc.

Three Deployment Options :


MSCRM is the only CRM product available in the market who have 3 Deployment options,
On-Premise, Online and IFD (Internet Facing Deployment).

The Cloud :
Microsoft invests over $2 billion US dollars in cloud infrastructure every year. Microsoft
Dynamics CRM is one of the quickest and one of the easiest ways for your business to take
advantage of the cloud and cloud economies, including helping to reduce systems management
and maintenance costs as well as meaning you pay only for the capacity you need.
Value :
When considering costs—including licensing, services, training, deployment, administration and
maintenance — customers, media, and industry analysts regard Microsoft Dynamics CRM as
one of the best value offerings in the industry.
Language Support :
MSCRM is only product available in the market which is Available in more than 40 languages.

Access Clients :
MSCRM is only product in the market which could be accessible through Mobile, Outlook and
Web client. MSCRM 2013 also accessible from Tablet also.
.Net Development Platform :
MSCRM use .net framework. All Plug-Ins, Custom WF written in either C# or VB. Even the
whole MSCRM Pages, forms has designed in .net(.aspx page). So its easy for .net developer to
write code in MSCRM and make it understandable for itself.

Can we customize SVCUTIl.exe class of MSCRM or Can we create our custom


Early binding class for few entities ?

Difference between Query Expression and Query by Attribute ?

What is Dynamic Entity in Dynamic CRM ?

What is Security Depth Dynamic CRM ?

Can we Export Vanilla Solution from Dynamic CRM ?

What is Inherited Security Role in MSCRM ?

What is Data Impersonation in MSCRM ?

if you change BU of any CRM user is it mandatory to change security role of


that user ?

Difference between System Administrator and System Customizer Security


Role in Dynamic CRM ?

Advantages of using Web Service in C# ?

Address , Binding and Contract Web Service in C# ?

How can we restrict any 'Entity Field' from being shown in Advanced Find ?
Answer : Using Searchable Property of attribute(Entity Field.

Did you know that you can set each attribute of each entity to be able for advanced find or
not?
By doing this you can specify which fields the users can search on. That means that all the
fields which you do not use in your CRM system can be removed from the list to make using
the advanced find easier.

So how do you do this? Just:


- go to system
- customization
- customize entities
- select any entity
- go to the tab attributes
- select any attribute
- switch the flag 'Searchable'

Can we do the same using Field Security Profile ?


Answer is NO, the difference is described below:

if user A is added to Field level profile where he is not able to read field A then
when user A does the advanced find, system will display this column in advanced
find but it will be blank column (meaning user will not see/read the value and field
level security will be applied).

How can we restrict any 'Entity' from being shown in Advanced Find ?
Answer ; Using Security Role:
Best way to achieve this is apply security settings if you remove the read/view
permission of unused entity in CRM security, then those entity will not available.

But if you have read privilege on the entity and still you want that entity not to be shown in
Advanced find or If you want permanently hide entity from Advanced Find then there is no
supported way.
But there is an unsupported way to achieve the same. CRM exposes below Boolean property
in EntityMetadata to identify which entity should appear in Advanced Find.

EntityMetadata.IsValidForAdvancedFind Property - Gets or sets whether the entity is


will be shown in Advanced Find.
AttributeMetadata.IsValidForAdvancedFind Property - Gets or sets the property that
determines whether the attribute appears in Advanced Find.

Try below query to hide Account entity from Advanced Find.

update MetadataSchema.Entity set IsValidForAdvancedFind = 0 where Name = 'account'

update MetadataSchema.Relationship set IsValidForAdvancedFind = 0


where ReferencingEntityId = (select MetadataSchema.Entity.EntityId from
MetadataSchema.Entity where Name = 'account')
and IsValidForAdvancedFind = 1
Reset IIS and clear server(and client) cache.

This will hide the entity for all users on the Advanced Find.

When do we register a plugin in child pipeline. give examples ?

What are images. What are its types and Why are they used ?

What are images. Why are they used. ?

When can infinite loop occur in a plugin. How do you avoid infinite loops in
plugin code.

what are filtered views?

if you delete a record from UI, what happens in database. can you bring the
record back?

What is deletion service? Can you change its schedule ?

Lesson: Relationships and Records - Entities are described as a record type, such as an Account or
Contact. Fields are specific data, forms are a collection of fields, and relationships are a dotted line
between records.

Here are a few limitations to using business rules:


Business rules run only when the form loads and when field values change. They do not run
when a record is saved, unless the scope for the rule is set at an entity level.
Business rules work only with fields. If you need to interact with other visible elements, such
as tabs and sections, within the form you need use form scripts.
When you set a field value by using a business rule, any OnChange event handlers for that
field will not run. This is to reduce the potential for a circular reference, which could lead to
an infinite loop.
If a business rule references a field that is not present on a form, the rule will simply not run.
There will be no error message.
Whole Number fields that use the formats for TimeZone, Duration, or Language will not
appear in the rule editor for the conditions or actions, so they cannot be used with business
rules.
You can’t add more than ten if-else conditions in a business rule.
For Microsoft Dynamics 365 for tablets, the definition of the business rules are downloaded
and cached when Dynamics 365 for tablets opens. Changes made to business rules are not
applied until Dynamics 365 for tablets is closed and re-opened.
When you set the value of a lookup field, the text of the primary field value that is set in the
form will always match the text that is visible in the rule definition. If the text representing
the primary field value of the record you are setting in the lookup changes, the value set by
your rule will continue to use the text portion of the primary field value defined by the rule.
To fix this, update the rule definition to use the current primary name field value.
It is useful to understand that the value set for a lookup has three parts:
Name: The text of the primary field value you see in the form.
Id: The unique identifier for the record. This is the data that is saved. This is not visible in the
form.
LogicalName: The name of the entity, such as contact, account, or opportunity.
The rule will set all three parts of this value. The Id value for a specific record never changes,
but the Name value might change.
For example, if you define a rule to set a lookup to a contact that has the Full Name of ‘Old
Name’, this text is the Name you will see in the lookup when it is set by your business rule
even if someone later changes the Full Name of the contact to ‘New Name’. The lookup Id
value will be correctly set to the expected record, but the Name (which is not saved) will
reflect the rule definition value rather than the current Full Name value of the record it
references.

Async workflows run in the background, while synchronous workflows run and hold you up
until they're complete.

Workflows can update records with a N:1 relationship (a lookup on the record), but they
cannot run on 1:N relationships (those on the left navigation or in a sub-grid). So using a
workflow, you cannot automatically update all the contact addresses when the parent
account address changes. But this can be done with a plug-in.
https://crmbusiness.wordpress.com/2014/09/30/microsoft-dynamics-crm-not-working-check-these-
common-causes/

Microsoft Dynamics CRM not working?


check these common causes
September 30, 2014Hosk

I started up the DEV server too start my CRM dev this morning only to be confronted with a big fat
error

The same error happened on every page, so it’s a fundamental error.

Yesterday IT sent an email warning me they would be gently powering down the servers for some
maintenance (I bet they really just turned them off).

These common errors are another bonus of companies moving to the cloud because these problems
won’t occur or will be fixed by Microsoft.
Check the time on the server
Checking the time on the server seems an odd thing to do, but if the time on the server is greater than
5 minutes out from your PC then CRM will fail to authenticate the user. This is a common problem
which pops up and to resolve this you need to get the IT team (or you if you don’t have one) to make
sure you setting the time on the server properly (e.g. the same as the PC’s) so it stops the servers time
drifting.

Check the CRM Asynchronous services

This should be your first thing to check because if the ASYNC services have stopped then CRM will
stop working. If you want to learn more about CRM Asyncs, you can go here

Asynchronous service in Microsoft Dynamics CRM


To see if the Async services are running, Microsoft have a document for starting and stopping
1. Navigate to Start, select Administrative Tools, then click Services.
You should find there are four CRM Async services and you can see if they are started

The Async processing service is usually the cause of CRM not working.

The problem displayed on this page was caused

If you have restarted the Asyncs and CRM is still not working

Check IIS is up and running

go to the Start menu


type IIS
It will bring up Internet Information Services (IIS) Manager
IIS is the webserver which hosts the Microsoft Dynamics CRM website. Some times you can find
this may be stopped (very very rarely but its something to check, so we can rule it out)
There are a couple of things to check
CRM Application pools are running
CRM web app will have an application pool to run the web app, you need to double check its started
and running. The app pool will usually be set to a service account, the main reason you use a service
account is because you don’t need to reset the password every 60 days. Sometimes this setting won’t
have been set and the app pool password will change and until someone goes in and puts/resets the
password the CRM App pool will stop working. When the CRM app pool stops working, CRM
stops working.
Its worth noting if any of the other app pools are not started because they may be stopped on purpose
or maybe have been stopped accidently.
you cann see the CRMAppPool below

Is the CRM Website up


if you click on the CRM website called Microsoft Dynamics CRM then the details of the web app
will appear on the right, you need to check the start is greyed out (which means it is selected)
World Wide Web Publishing Service
There is also a service which controls if IIS is up and running and this is called the World Wide Web
Publishing Service (named in the 1990’s I should imagine, not many times you see the words of
WWW). This can be turned off to stop IIS springing back to life after the server has been rebooted.

SQL Server
I often think of CRM as a web application to show the contents of the CRM SQL database. If the
SQL CRM instance is down, SQL server is off or can’t be contacted then CRM will stop working.
If CRM isn’t working you need to check the SQL server (usually on a different server) is up and
running and the CRM instances are running.
Windows Event Viewer

They are some common things to check if CRM isn’t working but you will also need to check for
some pointers for other errors. The place I usually start is by checking the Event Viewer log on the
CRM server.
Go to the CRM Server

Start Menu – type in Event Viewer

or
Control Panel –> Administrative Tools –> Event Viewer

Windows Logs –> Application

Look at the errors and warnings to see if there is anything which might point you in the direction of
the potential error. It’s unlikely you will actually get an error, usually I find it’s a warning and the
warning will point you in the direction of the cause of CRM not working.

here is the logs from the server for the error shown at the top of the blog
You can see there are a view warnings, a .NET, a sandbox. Be warned there is often a lot of noise in
the event logs (e.g. warning and errors which are not important).
I lookeda the .NET error

Process information:
Process ID: 5348
Process name: w3wp.exe
Account name: DEV\CRMAPPPOOL
Exception information:
Exception type: CrmException
Exception message: The plug-in execution failed because no Sandbox Hosts are currently
available. Please check that you have a Sandbox server configured and that it is running.
System.ServiceModel.EndpointNotFoundException: Microsoft Dynamics CRM has
experienced an error. Reference number for administrators or support: #72E41A64
atMicrosoft.Crm.Application.Platform.ServiceCommands.PlatformCommand.XrmExecuteInt
ernal()
atMicrosoft.Crm.Application.Platform.ServiceCommands.RetrieveMultipleCommand.Execute
()
atMicrosoft.Crm.Caching.DefaultSavedQueryIdCacheLoader.LoadCacheData(SavedQueryId
CacheKey key, IOrganizationContext context)
at Microsoft.Crm.Caching.CrmSharedMultiOrgCache`2.LookupEntry(TKey key,
IOrganizationContext context)
at Microsoft.Crm.Caching.DefaultSavedQueryIdsCache.TryLookupEntry(Int32objectType,
Int32 savedQueryType)
atMicrosoft.Crm.Application.Components.Sdk.FormControls.Web.LookupControl.Configure
Control()
atMicrosoft.Crm.Application.Components.UI.CrmUIControlBase.ConfigureControlInternal()

It pointed to the Sandbox service and when I checked the CRM services, I saw the sandbox service
was stopped. I started the sandbox service and CRM popped back into life.

How to join two table using Query Expression?


Using Linked entity. You should always try to minimize the number of SWS calls that we make in the
database. Often during code review it is explored that the number of Microsoft CRM web-service could
have been reduced by making use of the Linked-entity concept. So we should always look for the
opportunity to minimize the effort.
 What are the most common mistakes you see companies make with CRM?
Many organizations use Outlook BCM or Excel for managing their contacts, which offer no planning or
setup process — just create a column or type in a field and get started. This causes problems when
information is related and the flexible aspects of the previous solution are overlooked. There are real
benefits that won’t happen without understanding the new vernacular; the specific way the new solution
describes the data. For example, an “account” in Salesforce may not be the same as an “account” in
Highrise. In fact, it might have another name altogether, such as “company.” Understanding how the
particular vendor uses “leads” or “opportunities” will help to avoid a great deal of frustration.

 How is CRM changing and what does the business owner need to be aware of?
At the heart of CRM is the benefit of having the customer record at the center of the data universe rather
than multiple galaxies of transactions held in separate, transaction-specific apps. So the innovation lies in
new and improved visibility for putting information to use in intelligent decision making. Companies that
used to serve 100 are serving 10,000, and with this kind of scaling, better top-level tools and custom
dashboards are where I see CRM continuing to morph and advance.
19. Who are the newcomers to the CRM landscape?
It is such a hot area right now, there are literally hundreds. But two I have been following are Zoho and
HighRise. Both are niche vendors that have garnered great contact lists with their other products and
created relatively simple implementations for their clients and others. They both illustrate the fact that
CRM is no longer esoteric — it is going mainstream, which is a great thing for business, particularly
customer service and data security.
20. How much should I plan to spend on a good solution?
That’s always a tough question, given that applications vary widely in price based on whether it’s a
hosted or installed delivery model, user-based or organization-wide subscription model, or a per-gigabyte
or other data model. I would use the cost-per-sale and cost-per-lead values to help determine what a
system is worth to a business. For most customers, services are going to be anywhere from $20 to $350
per month per user.

 What exactly should I be expecting CRM to do for me?


This is an important question, as there are many misconceptions about software and CRM in particular.
Besides some fundamentals, like data security and access and ease of use, CRM will primarily help you
do what you do anyway, but move it to the next level. If your main focus is customer service, CRM will
help you monitor, deliver, and measure your effectiveness. If your goal is a flat organization where the
right hand knows immediately what the left hand is doing, CRM will help you be informed about the
customer’s world and not just what relates to your department or team.

 What are your expectations for CRM in the next five years?
First, I expect CRM to become much more commonplace. Players like Zoho and 37signals (Highrise) are
knocking down barriers to entry. I also expect to see some consolidation. I think the bigger players, like
Salesforce, Microsoft, and SAP, will buy up some of their smaller rivals to build into their suites and
migrate their user bases. As long as the acquiring provider keeps the connections intact during the
migration and meets a similar price point, it will be a win-win. I also think we’ll be seeing more mobile-
friendly applications, like Salesforce’s Visualforce and NetSuite’s iPhone, to maximize data access and
timeliness.

You might also like