Hi,
I am setting up a lookup field value which is retrieved from another lookup field value on same entity form.
Here is the script:
function sample()
{
debugger;
var ExistingCase = Xrm.Page.data.entity.attributes.get("new_userteam");
if (ExistingCase.getValue() != null) {
var ExistingCaseGUID = ExistingCase.getValue()[0].id;
var ExistingCaseName = ExistingCase.getValue()[0].name;
var lookupValue=new Array();
lookupValue[0] = new Object();
lookupValue[0].id=ExistingCaseGUID;
lookupValue[0].name=ExistingCaseName;
lookupValue[0].entityType="incident";
Xrm.Page.getAttribute("new_lapcounty").setValue(lookupValue);
}
}
I debug the script but I don't see anything wrong but value is not getting set up!
Can someone please let me know what I am doing wrong? Thanks.
*This post is locked for comments
I have the same question (0)