Opening a quick create form in Dynamics 365–Use Xrm.Navigation.openForm instead of deprecated Xrm.Utility.openQuickCreate

Dynamics 365 and PowerApps are an ever changing world and in this ever changing world, keeping track of the changes while being busy at work is really hard. And I realized that hard while recently as I was using Xrm.Utility.openQuickCreate to launch a quick create form from client side API.

Xrm.Utility.openQuickCreate has been deprecated and you should be using Xrm.Navigation.openForm to actually open up a quick create form.

Sample code courtesy Microsoft Docs.

var entityFormOptions = {};
entityFormOptions["entityName"] = "contact";
entityFormOptions["useQuickCreateForm"] = true;

// Set default values for the Contact form
var formParameters = {};
formParameters["firstname"] = "Sample";
formParameters["lastname"] = "Contact";
formParameters["fullname"] = "Sample Contact";
formParameters["emailaddress1"] = "contact@adventure-works.com";
formParameters["jobtitle"] = "Sr. Marketing Manager";
formParameters["donotemail"] = "1";
formParameters["description"] = "Default values for this record were set programmatically.";

// Open the form.
Xrm.Navigation.openForm(entityFormOptions, formParameters).then(
     function (success) {
         console.log(success);
     },
     function (error) {
         console.log(error);
     });

More details about openForm is mentioned here in Microsoft docs.

Hope this helps!

Debajit Dutta

(Business Solutions MVP)


Discover more from Debajit's Power Apps & Dynamics 365 Blog

Subscribe to get the latest posts sent to your email.

Discover more from Debajit's Power Apps & Dynamics 365 Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading