Using Xrm.Navigation.openForm to Open Quick Create in Dynamics 365

Leave a comment

We can use Xrm.Navigation.openForm to open a Quick Create using JavaScript.

Let’s say we want to open the Account quick create form on a Contact record in the Unified Client Interface / Unified Interface. Let’s go to a contact record:

To simply open the quick create without setting any field values, we can use the code:

var entityFormOptions = {};
entityFormOptions["entityName"] = "account";            
entityFormOptions["useQuickCreateForm"] = true;
Xrm.Navigation.openForm(entityFormOptions, null).then(
                function (lookup) { console.log("Success"); },
                function (error) { console.log("Error"); }

Hitting F12 to run this code in developer tools, we see the quick create is open:

To set the values of fields, we can pass a 2nd parameter with the fields:


var entityOptions = {};
entityOptions["entityName"] = "account";            
entityOptions["useQuickCreateForm"] = true;

var formParameters = {};
formParameters["name"] = "Test account";

Xrm.Navigation.openForm(entityOptions, formParameters).then(
                function (lookup) { console.log("Success"); },
                function (error) { console.log("Error"); }

This defaults the name to Test Account on the account quick create:



Carl de Souza is a developer and architect focusing on Microsoft Dynamics 365, BI, Web, Cloud and Data Science.

carldesouza.comLinkedIn Twitter | YouTube


Leave a Reply

Your email address will not be published. Required fields are marked *