Friday 23 June 2017

Organization Insights in Microsoft Dynamics CRM

Step By Step Process to use Organization Insights in Microsoft Dynamics CRM

Hi All. In CRM, a new feature "Organization Insights" has been added which helps in keeping track of 'Active Usage', 'System Jobs', 'API Call Statistics', 'Storage', etc.

Here I am going to explain in a very simple way how to use Organization Insights in Dynamics 365 CRM.

  Step 1: Go to 'System Settings' inside Administration:


Step 2: Set 'Enable Organization Insights Preview' to 'Yes':

Step 3: Go to Home page of Dynamics 365 account:

Step 4: Click on '+' sign as shown below to add new application:

Step 5: Search 'insights'. You will see "Microsoft Dynamics 365 - Organization Insights". Click on "Get it now". After few minutes (not more than 2min), it will get installed:

 Step 6: Go and check a new solution for Organization Insights. It means it is now successfully installed:




Step 6: Go to the 'Settings' tab. You'll find there 'Organization Insights':


After clicking, you'll get your insights. :)



Enjoyyyyy :) :) :)

Saturday 19 November 2016

Use CRM Dialog to set a lookup value from a list of records

Use CRM Dialog to set a value

Hi All. In CRM, sometimes we face a requirement where we have to select a lookup record from a list of records and then set it to some field.

Here I am going to explain how to use a CRM - Dialog to set a lookup field by selecting a record from a list of records.

Lets take an example. I have a lookup field "Manager" (lookup of User). I want to show a list of System Users with some filter criteria. The CRM user will select a record from the list and then this selected record will get set to the field "Manager":
  Step 1: From Customization, create a new Process and select the category as "Dialog":


Step 2: Add step "Query CRM Data":

Step 3: Select the entity "User" and add the filters and save it:

Step 4: Add a page to display Prompt and Response.

Step 5: Select the row and add Prompt and Response. Set the properties as shown below:

 Step 6: Add a new step to update the Account record and click on set properties:


Step 6: Click on Manager to select this field. On the right hand side, select "Select Manager (User)" and click on OK as shown below:





After clicking on OK, the value gets set to Manager.



 Now the properties of dialog looks like below:


Step 7: Open the Account record and select the "Start Dialog". A list of dialogs is shown up. Select "Dialog - Set Manager of Account":


 Step 8: The dialog gets opened. Select any User and click on Finish. The value will get set to the field "Manager":

 Now the value gets set to the field as shown below:

 This is how the CRM dialog works to set a value from a list of records.

Tuesday 16 August 2016

Unlock Pricing in Microsoft Dynamics CRM i.e. at Opportunity Product, Quote Product or Order Product

Unlock Pricing in Microsoft Dynamics CRM

Hi All. In CRM Online, we generally face the problem where the field "Pricing"("ispriceoverridden") becomes locked at Opportunity Product, Quote Product or Order Product. So, the user becomes unable to change this field.



Here I am going to explain how to overcome this problem at Order Product level. You can follow the similar steps at Opportunity Product and Quote Product also.

Step 1: Create a javascript webresource "OrderProduct" with the below code:

function unlockPricing() {   
    Xrm.Page.ui.controls.get("ispriceoverridden").setDisabled(false);
}

function onLoad() {
    setTimeout(unlockPricing, 3000);
}


Step 2: Add the webresource to the Order Product form:


Step 3: Add the onLoad() function to the OnLoad event of the form:


Step 4: Save, publish and refresh the Order Product record. Now you can see the field is unlock and editable.


The reason for using the function setTimeout() is that if we simply add the function to unlock the field, it doesnt work because after form load event, the internal CRM function is called and locks the field. So, by using the function setTimeout(), the system waits for 3,4 seconds and then unlocks the field. In this way, it works successfully.

Wednesday 3 August 2016

SSRS Prefiltering not working in CRM

SSRS Prefiltering not working in CRM


Hi All. Sometimes it happens in CRM that the prefiltering of the report doesn't work. It means if we run the report for a selected record, it runs for all records instead of the selected record. Here, i am going to explain one of the reason for this with an example with few steps and the solution for this:

1). Create a simple report in visual studio say Report_A. Don't add prefiltering on the data-set of the report.



2). Create a CRM report "Report A". Add "Report_A" in it.


3). Now open any Contact record. Go to report menu. Click on report. You will see that the report comes under the heading "Run on All Records". It means the report will run on all records and not on the selected record.


4). Now add prefiltering on the report and upload it to CRM. Refresh the page. You will still see the report under the heading "Run on All Records".

This is the bug with the CRM reporting. Even after adding the prefiltering in the report, it still runs on all records. So, the solution is, delete the report from CRM and add it again. Refresh the page. Now you will see the report under the heading "Run on Current Record".

Thank You

Tuesday 26 July 2016

How to Fulfill an Order by C# code in Microsoft Dynamics CRM

Hi All. Sometimes we come across certain situations where we need to Fulfill an Order by our code of Plugin or Workflow. Here I am going to explain you step by step how to Fulfill an Order via C# code in Microsoft Dynamics CRM.

Step1:

Get the GUID of the Order record which you want to fulfill. Lets say "orderGuid".

Step2:

Get the optionset value of the "Status" which fulfills the Order. In my case it is 100001(Fulfill).

Step3:

Add the reference "Microsoft.Crm.Sdk.Messages" to your code.
"using Microsoft.Crm.Sdk.Messages;"

Step4:

Add the below code:

FulfillSalesOrderRequest req = new FulfillSalesOrderRequest();
req.OrderClose = new Entity("orderclose");
req.OrderClose["salesorderid"] = new EntityReference("salesorder", orderGuid);
req.Status = new OptionSetValue(100001); //Fulfill = 100001
localContext.Trace("before executing");
FulfillSalesOrderResponse resp = (FulfillSalesOrderResponse)localContext.OrganizationService.Execute(req);
localContext.Trace("after executing");

Explaination:

In CRM, we have an entity called as "orderclose". When an order gets fulfilled, an entry is created in this entity with the reference of the fulfilled order. Here, we have achieved the same thing via c# code.