Hi All,
I have a requirement to default the "from" field on the email entity upon load. I have written the below code. I know it is not best proactive to code a GUID, but I need this for a demo. The below script is on load. I do not get any
errors when I run the code, the value of the "from field" becomes null. Any help would be much appreciated.
function setPartyList() {
var partyRequired = Xrm.Page.getAttribute("from");
// Create new array
var partlist = new Array();
partlist[0] = new Object();
partlist[0].id = "fb2ccc5f-6e18-4ca2-8caf-361b6e1c1724"; //Guid (i.e., Guid of User or Contact etc)
partlist[0].name = "Joe Schmo"; //Name (i.e., Name of User or Contact etc)
partlist[0].entityType = 8; //entity schema name of account or contact
// Set array value
partyRequired.setValue(partlist);
}