Hi all,
I am trying to set an entityreference to a partylist field. Till now its only possible for me to set a string as reference to an account, but i want to fill the field with the account name.
This is my code:
var parameters = {};
var partylist = Xrm.Page.getAttribute("to"); // "to" is the name of the partylist field
var partlist = new Array();
partlist[0] = new Object();
partlist[0].id = "982D83BD-2FBA-E711-8119-5065F38BF4D1";
partlist[0].name = "TESTNAME" // here i want to set the name of the account, wich i want to reference to.
partlist[0].entityType = "account";
parameters["phonenumber"] = "0843148191";
parameters["to"] = partylist.setValue(partlist);
var windowOptions = { openInNewWindow: true };
function openNewPhoneCall() {
debugger;
Xrm.Utility.openEntityForm("phonecall", null, parameters, windowOptions);
}
The reference to the current account with the GUID (982D83BD-2FBA-E711-8119-5065F38BF4D1) is working, but i want to fill the partylist field with the name of the account.
Hopefully there is someone who understands my requirement and can help me.
Thanks for the help.
*This post is locked for comments