Search code examples
dynamics-crmcrmmicrosoft-dynamicsdynamics-crm-onlinedynamics-crm-2016

Issues with the "setDefaultView" in CRM Online 2016 Update


I have written following code in the page load to filter a lookup based on a view.

function SetDefaultViewOnSalesManagementLookup()
{
var control = Xrm.Page.getControl("header_process_sfw_bidauthorisedbysalesmanager");
if(control){
    control.setDefaultView("{66078611-FB47-E611-80FC-C4346BDDB001}");
}
} 

I have exported the solution to multiple instances, and it works fine everywhere except one instance which is latest CRM Online 2016 update.

The lookup doesn't show up any record, and when I click on "Look for more records", it gives an error of insufficient permissions on dialog.

I have verified that the view exists in the system, and user has required permissions on the underlying entity.

Any idea if there is any change in latest update for this?


Solution

  • Well strange things do happen!!

    I opened the form in designer mode.. disabled the execution of the particular method which contains scripts for setting default value to the lookup control.

    Published the solution.

    Then again, enabled the script execution...

    and to my surprise, the lookup field started working...