Dynamics 365 v9.0 – Show Lookup Dialog is here

Microsoft has recently released Developer Guide for Dynamics 365 v9.0. From now on wards, only online version of documentation is available. You can find latest documentation here

One of the new Dev feature caught my eye was the ability to show Lookup Dialog using Xrm.Utility.lookupObjects method. Earlier, we used to go with unsupported method to show Lookup Dialog which is no longer required. Here is how it has to be done in v9.0 onwards.

Lets assume a scenario where we have a custom ribbon button “Assign”.

when user clicks on this ribbon button a Lookup Dialog has to be shown with list of system users. On selection of a specific user, owner field has to be updated with it and record has to saved.

Following is the code which does the required functionality and also

Limits list of views to be shown

Sets Return Value to Single

This new method expects an object with list of parameters to be passed and success and Cancel callback functions.