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