Auxiliary Force Technology

Open New Dynamics CRM Record with Pre-Populated Fields

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";

Xrm.Utility.openEntityForm("phonecall", null, lookupItems);