Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 79901

Setting a lookup field value

$
0
0

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.


Viewing all articles
Browse latest Browse all 79901

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>