Open New Dynamics CRM Record with Pre-Populated Fields

· Microsoft Power Apps and Dynamics 365, Tips and Tricks

A very common JavaScript customization is to open another Entity with pre-populated Fields from the original Entity. This is achieved using the “openEntityForm” method provided by the Microsoft SDK. In the example below, this code could be triggered from the Opportunity to open a Phone Activity that populates the “Name,” “Regarding,” and “Regarding Type” from the Opportunity.


var lookupItems = {};

lookupItems["parameter_regardingname"] = Xrm.Page.getAttribute("name").getValue();
lookupItems["parameter_regardingid"] = Xrm.Page.data.entity.getId();
lookupItems["parameter_regardingtype"] = "opportunity";</p> <p>
Xrm.Utility.openEntityForm("phonecall", null, lookupItems);

All tutorials

Tell us what’s stuck.

Book a 30-minute call. You’ll get a straight answer on whether we can help and what we’d do first.

Book a call