Run On-Demand Workflows on bulk records using XrmToolBox – bulk workflow execution

Microsoft Dynamics CRM On-Demand workflows are great and help in so many ways/

you can easily run these on records such as 100 , 500, 1000 & may be on 2000? But wait… how about 10000 records? thats where it might become very hectic but with introduction of a new plugin/tool in XrmToolBox – it has become very easy. – thanks to Andy Popkin 🙂

All you have to do is download XRM toolbox from the main website or github :

Now once you have this tool and extracted – you might not have the bulk workflow execution tool in it. you will have to go to plugin store from the xrm tool and add it as belowpluginstore

once you go there it will give you hell lot of plugins you have to look for “bulk workflow execution” plugin and install it as below :


once this is done you should be able to search this tool in your XRMtoolbox :


double click on it and get into action

  1. make sure your workflow is already is configured to run as ondemand
  2. all ondemand workflows in the organization will come under the dropdown i have highlighted.
  3. once you select the wofklow – it will give a list of all views from the entity which is a primary entity of the workflow. you can select the view and run your workflows on view returned records.
  4. you can also define your own custom fetch XML query ; which we will do now.


here i am using the below fetch XML as an example :

<fetch distinct=”false” mapping=”logical” output-format=”xml-platform” version=”1.0″ >

<entity name=”task” >

<attribute name=”subject” />

<filter type=”and” >

<condition attribute=”scheduledend” operator=”null” />

<condition attribute=”statecode” operator=”eq” value=”0″ />

<condition attribute=”createdon” operator=”on-or-before” value=”2017-12-15″ />





you can click on validate to validate your query ; once your query is confirmed you will have run workflow button enabled next to it and also will show how much record it has retrieved. click on the run workflow button and see the action :


it will work like a charm and will definitely save alot of your time.

i will be sharing more cool add-on in XrmToolBox because i am a fan of this tool ; so stay tuned.






Escape from waiting condition workflows – Microsoft Dynamics CRM

Waiting condition workflows are definitely great and almost perfect for the functionality where you have to wait for months for something to be triggered.

but are they really good ; should actually keeping them alive for months is a good idea? Well there are certain measures that you can take if you really need them :

  • Combine waits and check condition. So you have a process that emails a customer service representative three days after the case is open. No need to email them if the case has been closed, right? After the wait, have the workflow check conditions to verify that the condition that triggered the workflow is still true. If not, cancel , but stop it.
  • Use a child workflow to do something when wait time is over.
  • Use short wait periods. 20  minute waits are ok. 1 year waits are bad.
  • Use timeouts rather then wait condition.


however apart from the above there is another way which can be effective in terms of your organization performance.

Create an entity to keep the crucial date or timestamps on which you want to do something.

  1. create an entity(workflow task) , with fields as “regarding” & “Due date”.
  2. In your workflow – if you need to do something for example 20 days before the expiration date – calculate that date and create a a new record for the entity created(workflow task) with regarding as the current record and the date in due date field.
  3. Stop your workflow – just end it right there.
  4. Create a bulk delete job -that you should run everyday which checks for the records who’s due date is today and delete them.
  5. Create a workflow on the new entity created(workflow task) – run it on deletion of the record and do the actual things you wanted to on your record from that workflow for example closing the activity , sending email etc.


Best thing about this approach this that you can continue using this logic in your organization with n number of records & entities.


let me know your thoughts on this.

Cheers !

Sample Questions & Tips for Exam MB2-713: Microsoft Dynamics CRM 2016 Sales

It is the most difficult and interesting crm certification i have come across.

i am going to give you some tips and sample questions that you can expect.

  1. understand the CRM sales process :
  2. guidance from a champion :
  3. finally some sample questions:

1.Your Dynamics CRM organization uses Microsoft Yammer.
You plan in enable integration with Yammer to replace the default CRM activity feeds.
You need to identify which security rights are required to enable the integration.
Which two security rights should you identify? Each correct answer presents part of the solution.
A. Dynamics CRM administrator
B. Dynamics CRM System Customizer
C. Yammer administrator
D. Microsoft SharePoint administrator
E. Microsoft Office 365 administrator

Answer :AC

2. You Open the My Open Opportunities view,
You need to export the data in the view, and then to reimport the data so that the existing records are
What should you do?
A. Export the data as a dynamic Pivot Fable.
B. Export the data as a Static worksheet.
C. Export the data and select the Make available for re-import option.
D. Export the data as a dynamic worksheet

Answer : B

3.You have a recalled product that should no longer be sold.
You need to remove the. Product from the available list of products and to prevent any sales from being
processed for the product.
Which two actions should you perform? Each correct answer presents part of the solution.
A. Remove the product from the family hierarchy.
B. Modify the open opportunities.
C. Update the price list.
D. Retire the product.
E. Modify the validity date of the product.


4.You have an existing customer named customer1.
You have a new add-on product for an existing product that you sell.
You want to offer the add-on product to a customer who has purchased the existing product already.
You need to track the sales initiative in Dynamics CRM.
What should you do?
A. Update the original opportunity record.
B. Create a new opportunity record for the new offering.
C. Create a sub-account for the new offering.
D. Reopen the original opportunity record.

Answer : B

5.Your marketing team is promoting a sale that they will announce by using email. The email message will
be sent to existing customers who recently purchased similar products and to potential customers from
a purchased mailing list.
Any sales made as a result of the sale need to have the pricing applied, the sales must be tracked so that
the marketing team can report on the return on investment (ROl) of the initiative.
What are two possible ways to achieve the goal? Each correct answer presents a complete solution.
A. Convert the email activities to leads.
B. Convert the campaign response activities to opportunities.
C. Convert the campaign response activities to leads.
D. Convert the email activities to opportunities.

Answer : BD

6.You have a Dynamics CRM organization that has several currencies enabled. What occurs when a user
creates a record that has a currency field?
A. The currency is based on the sales territory of the user.
B. The currency is based on the location of the user record.
C. The currency is converted into the base currency and is always displayed in the base currency
D. The system default currency is the record default, unless a customer has a default currency

Answer : D

7.You company employs consultants who bill customers for their time.
You sales team is responsible for selling the consultants time, in addition to selling product licenses.
You need to provide the sales team with the ability to create opportunities, quotes, and invoices for the
consultant’s time.
What should you create first?
A. a product family
B. a price list
C. a product bundle
D. a unit group

Answer 😀

8.Your company plans to deploy Dynamics CRM.
In the previous sales database, you did not track products
Members of the management team are evaluating whether to use the product catalog in the CRM
organization. You need to identify which enhancements to the sales flow can be achieved by using the
product catalog. What are two possible enhancements that you can identity? Each correct answer
presents a complete solution.
A. inventory management integration
B. automated sales pipeline velocity tracking
C. automated revenue calculation
D. automated quotes, orders, and invoicing

Answer :CD

9.Your company has a Dynamics CRM organization.
The company plans to use the product catalog.
You need to identify which component must be configured before you can implement the product
A. product families

B. product
C. price lists
D. unit groups


Answer : D

10.You need to identify which type of object can be associated to sales territories. Which type of object
should you identify?
A. Opportunities
B. Users
C. Leads
D. Facilities
E. Teams

Answer : B


Hope this helps

you can write to me @ if you need any support.


Microsoft Dynamics CRM 2016/2015/2013- Dynamic and Static Marketing List

This has been a most population concept in marketing module of CRM ; i would like to share some crucial difference between them:

Dynamic marketing lists is able to save time and ensured that everyone that should be on the list was on the list.

A Static marketing list is a snapshot in time. You add the contacts you want in that marketing list depending on certain criteria…and that was it. If a new contact is added to the CRM database you can manually add them to the marketing list, or if the marketing list is no longer relevant to a contact you can manually remove them.

Dynamic marketing lists removes the manual element. You can create a query (e.g. all customers where their country equals Ireland). This means that any contacts with “Country = Ireland” will be added to the list. As you add new contacts to the CRM database, they will automatically be added to the marketing list if they live in Ireland. If a contact moves and the Country field in the contact card is updated, then they will be automatically removed from the marketing list.


Some other major differences below :

Dynamic List Static List
Member types Leads, Contacts or Accounts Leads, Contacts or Accounts
Adding members The query to select members automatically adds records which meet the criteria You can manually add records using the Add to Marketing List button
Manage Members – Add records using a lookup
Manage Members – Add records using an advanced find
Removing members Members are automatically removed if they no longer meet the dynamic list query criteria Manage Members – Advanced find to Remove records
Manage Members – advanced find to evaluate members
Blocked attribute You cannot block a dynamic list (you can use the copy to static button to copy the members of a dynamic list to a new static marketing list) You can block a static list, which stops members being added or deleted.
Updating list members automatic Manual – a static list has to be updated manually.
deactivated records/members Automatically excluded from the list
Can lists be added to a campaign Yes – All marketing lists can be added to a campaign and both static and dynamic can be added to the same campaign Yes – All marketing lists can be added to a campaign and both static and dynamic can be added to the same campaign


Happy CRM 🙂 cheers!!

Sample Questions & Tips for MB2-716 – Microsoft Dynamics CRM 365 Customization & Configuration

Hi Guys, I have recently passed MB2-716 ; hence thought putting some sample questions and tips on the this exam.

Hope fully it helps :

Which two series aggregate functions are only available on numeric field data types? Each correct answer presents part of the solution.

  1. Count: Non-empty
    B.    Count: All
    C.    Avg
    D.    Max

Answer: CD

Which of the following chart types can be configured as an organization-owned chart but not as a user owned chart?

  1. bar and line
    B.    tag or doughnut
    C.    line and multi-series
    D.    area and funnel

Answer: B

You are implementing a Lead to Quote business process. The process will update the Lead. Account Contact, and Quote entities. You need to create a business process flow (BPF) that spans the entities.
What should you do?

  1. For each stage, specify the step.
    B.    Add a workflow.
    C.    Use a composition.
    D.    Add a stage and specify the properties for each entity.

Answer: D

You need to create a business process flow (BPF) that spans multiple entities. Which of the following statements is true?

  1. You can use entities that have N:N relationships.
    B.    The same entity cannot be used twice.
    C.    Relationships must exist between entities.
    D.    You can include a maximum of five entities.

Answer: D

BPF can have 1: N Relationship, we can add same entity in different stages. Relationship is recommended between entities but can be set as None.

You create a business rule for the Account entity.
The business rule must nin when you import account records. Which two conditions must be true? Each correct answer presents a complete solution.

  1. The scope was set to Entity.
    B.    The scope was set to Account.
    C.    A business rule is active.
    D.    A business rule snapshot was successful.

Answer: AC

You are implementing a new business process.
The system must send a notification to the manager 24 hours after an opportunity Is created based on the date of the next best action.
Which type of workflow should you implement?

  1. synchronous workflow
    B.    asynchronous workflow
    C.    Microsoft Dynamics 365 dialogs
    D.    business process flow (BPF)

Answer: B

You create a business rule for the Case entity and set the scope to Case (form). Which action will cause the business rule to run?

  1. The form loads.
    B.    An asynchronous workflow updates the record.
    C.    An asynchronous workflow creates a record.
    D.    The record is saved.

Answer: A


Which action can you perform by using a business rule?

  1. Subtract $5.00 from a currency field.
    B.    Clear a two options field.
    C.    Concatenate two text fields.
    D.    Add six days to a date field.

Answer: D

You create a workflow and set the scope to User (default). User A owns the workflow. User B is making bulk changes on records that will trigger the workflow. Which records will this workflow affect?

  1. records owned by users in the same business unit as User B
    B.    records owned by User A
    C.    records owned by User B
    D.    records owned by either User A or User B

Answer: B

You are a subject matter expert for an insurance company. You have a complex business method that is used for settling and releasing claims.
You need to create a process in Microsoft Dynamics 365 to assist team members with the claims settlement process. You must limit this process to team members that have a specific security role.
What should you implement?

  1. business process flow (BPF)
    B.    workflows
    C.    custom actions
    D.    dialogs

Answer: A



please leave a comment or mail me at for any question.



Microsoft Dynamics CRM Import Error 0x80040237: Cannot insert duplicate key

When looking at the import log, check whether the error occurred below the “Entity Ribbon” Item Type:

error import

If this is the case, the most likely cause is duplicate or corrupt CustomControlDefaultConfigs. These are the control configurations that you can add as part of the CRM 2016 new features.  Some forums indicate that there are bugs in CRM for transporting these records which were fixed in SP1, Service Update 5. In the meanwhile the easiest workaround identified so far is to delete from source environment the CustomControlDefaultConfigs following these steps:

  1. Identify which entity caused the failure. For example, from the screenshot above we can see the failure comes from the particular entity.
  2. Open the solution customizations.xml file and find the problematic entity. Under that entity find the CustomControlDefaultConfigs node and extract the Guid(s) of the default CustomControlDefaultConfigId:xmlnew
  3. Now delete from the source environment this record. This cannot be done via UI unfortunately so it must be done using the API. Below is an example line of code on how to achieve this:

service.Delete(CustomControlDefaultConfig.EntityLogicalName, new Guid(“404c2f18-9142-e611-80df-000d3ab010db”));

  1. Publish all customizations in source environment
  2. Verify in database of source environment that the record is deleted. This line should return no values (replace with the appropriate GUID):

select * from CustomControlDefaultConfig where CustomControlDefaultConfigId = ‘404c2f18-9142-e611-80df-000d3ab010db’


  1. Re-export the solution and import again.


Hope this helps!


Microsoft Dynamics CRM form on load error with or without javascript

Users Sometimes experience an error while opening a contact/any entity. Its an intermittent error and not reproducible all the time and for all users.

Error looks like this in Dynamics CRM UI :



When you download the error logs ; below is found:

TypeError: Cannot read property ‘form_onload’ of undefined

    at eval (eval at RunHandlerInternal (http://organization/form/ClientApiWrapper.aspx?ver=2115568044:153:1), <anonymous>:1:42)

    at RunHandlerInternal (http://organization/form/ClientApiWrapper.aspx?ver=2115568044:158:1)

    at RunHandlers (http://organization/form/ClientApiWrapper.aspx?ver=2115568044:117:1)

    at OnScriptTagLoaded (http://organization/form/ClientApiWrapper.aspx?ver=21



I created a solution, added the contact entity with forms and exported the solution. Opened the customization XML and found below.

The error has to do with InternalHandlers that is calling a library and a function form_onload  which is somehow attached to this event Hence I had commented out the below InternalHandler property.


<event name=”onload” application=”true” active=”true”>


                    <Handler functionName=”Mscrm.ContactMainSystemLibraryWebResource.form_onload” libraryName=”Contact_main_system_library.js” handlerUniqueId=”4ea24ebd-795d-434e-af94-6812c3867b54″ enabled=”true” />

                  </InternalHandlers> –>


<Handler functionName=”custom function” libraryName=”contact.js” handlerUniqueId=”{a2a97e43-583d-a4be-3dcb-2369a34a4193}” enabled=”true” parameters=”” passExecutionContext=”false” />




Saved the customization.xml file and zipped the solution; imported back to CRM.

Hope this helps!


How to setup a mock service in SOAP UI. See CRM output XML. Integration Plugins Microsoft Dynamics CRM 2016/2015/2013

During my Career in CRM dynamics, I have struggled a lot when it comes to seeing what is going out of CRM so that it can be used to investigate things.

Especially the people who involve in a lot of triaging of issues & developing integration plugins and needs to validate it.


  1. WSDL of the target service.
  2. SOAP UI(any version would work)
  3. Up and running server where you have SOAP UI installed.

Open SOAP UI and create a new project:

wsdlBrowse to the WSDL and click okay.

now it’s time to generate a mock service:

once you have imported the WSDL it will show all the services it contains.You have to select the one you want a mock service for. and then right click on it and say generate mock service like below:

generate mock

once you do that it will give you the list of operations and the path of the mock service.

Verify the same and click okay:


here you go your mock service is ready:


Now you might have to modify the response you are getting from mock service to do that double click on the service (e.g here “buy”) than on the response add whataver you need.

close the box. click on the green button to run this service.addresponse

now in order for your CRM to reach to this service you have to configure this end point. either in your config file or if you read it from a custom entity in CRM.

now the endpoint would be the combination of your server address for.e.g.

you can get the mock service Path from the custom properties box on the left bottom.side.


once you do that all you have to do is to trigger the action and once you do that you have the request coming in the mock service in the below section:


double click on that than on the option format XML to see the XML you need.


Hope it helps.


How to enable encryption on microsoft dynamics crm 2016/2015/2013/365

Hi, Guys! I am going to show you today how to enable encryption in Microsoft Dynamics CRM. But first let’s have a look why one would want do that:

  1. you are not able to create queues.
  2. you are not able to create mailboxes.

In short, all confidential stuff in CRM where you require a user name or password it will be disabled if you have encryption disabled.

if you try to take action mentioned above you will get this error:

“There are encrypted fields in the organization database, but the data encryption feature isn’t activated. Contact your Microsoft Dynamics CRM system administrator to activate data encryption. To activate, go to System Settings > Data Management > Data Encryption…”

According to the error, to enable encryption we need to go into Data Encryption under Data Management. However, we can only enable Data Encryption if Dynamics CRM is using the https protocol, and usually, the reason we’ve done a backup/restore is that we’re setting up a Dev or UAT copy of Prod, which may not need to be https.

Data Encryption Errors After Restoring Microsoft Dynamics CRM Database

This error states that “The HTTPS protocol is required for this type of request. Enable the HTTPS protocol and try again.” However, enabling https may not be ideal, and we still need to be able to use the system.

Fortunately, there is a SQL script we can run on the config database which will allow us to use data encryption without using the https protocol:

UPDATE [MSCRM_CONFIG].[dbo].[DeploymentProperties]
SET [BitColumn]=1
WHERE ColumnName=’DisableSSLCheckForEncryption’

You shouldn’t do this on a production instance, but for Dev or UAT instances this is necessary.

Once that’s updated you need to do an IISRESET on the CRM server for the changes to take effect.

If we try opening that Data Encryption window again, we should see that encryption is disabled, and we can create a new key and activate it.

Data Encryption Errors After Restoring Microsoft Dynamics CRM Database

You should be able to get the encryption key from the original CRM system you backed up from. If not, then you can simply create a new encryption key.

When you activate, you might be faced with another error which states “Please select an account that is a member of the PrivUserGroup security group and try again”

Data Encryption Errors After Restoring Microsoft Dynamics CRM Database

A simple solution to this issue would be to use an account with which the CRM instance is installed or add this user to the security group mentioned in the error.




Get lookup value from other entity and set it on the form using Web API in Microsoft Dynamics CRM 2016

In this blog i am going to show you , how you can retrieve a lookup value from other entity in CRM 2016 using web api and set it on the form.

we know how its done in Odata but its time for some Web API action.

let see how its done here 🙂

function yourFunctionName() {

var lookup= Xrm.Page.getAttribute("fieldname").getValue();  //you will get the id with exxtra double quotes or square brackets by doing get value hence you to make it readable by CRM , you must slice it. i have use the below method:
var newid = lookup[0].id.slice(1, -1);  // you will get perfect id like "EDCJDKDJDKJDJDKJDJKD" here.
var req = new XMLHttpRequest(); //once you have the id , you have frame to make a webapi GET call by proving the newid we got."GET", Xrm.Page.context.getClientUrl() + "/api/data/v8.1/entitypluralname(" + newid + ")?$select=_prefix_fieldname_value", true);
req.setRequestHeader("OData-MaxVersion", "4.0");
req.setRequestHeader("OData-Version", "4.0");
req.setRequestHeader("Accept", "application/json");
req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
req.setRequestHeader("Prefer", "odata.include-annotations=\"*\"");
req.onreadystatechange = function () {
if (this.readyState === 4) {
req.onreadystatechange = null;
if (this.status === 200) {
var result = JSON.parse(this.response); // you will get the retrieved value in object we stored in result var.
var retrivedvalue= result._prefix_fieldname_value; //get the id of the field
var retrivedformatedvalue= result["_prefix_fieldname_value@OData.Community.Display.V1.FormattedValue"]; //get the formatted name of the field
if (retrivedvalue!= null) {
var value = new Array();
value[0] = new Object();
value[0].id = retrivedvalue;
value[0].name = retrivedformatedvalue;
value[0].entityType = "entityname";
Xrm.Page.getAttribute("fieldname").setValue(value); //set the lookup value finally
alert("some textt!!!!!!") // optional
} else {

you can call this function on change of the field.

i hope this helps!!  🙂