Follow below code to read and write the Lookup field of Dynamics 365 CRM.
1. To Read the value:
Below code are read the Name field value and store into org variable.
var org = formContext.getAttribute("min_organization")?.getValue();
var orgid = org[0].id;
var orgname = org[0].name;
var orgentityname = org[0].entityType;;
2. To Set/Update value:
Below code will be check the Name field contains data, if it contains then set/update the address1 field value.
if (org !== null && org !== undefined)
{
formContext.getAttribute("min_organization1").setValue([{ id: orgid, name: orgname, entityType: orgentityname }]);
}
No comments:
Post a Comment