Hi Friends,
Below is the code to copy the value of a look up field to another lookup field.
For example, on contracts, if you have to copy the value of the customer field to Bill to Customer field.
//Get the value of the custom customer field on the form
var vendor = crmForm.all.new_vendorsid.DataValue;
if (vendor != null)
{
var lookupData = new Array();
var lookupItem= new Object();
lookupItem.id = vendor[0].id;
lookupItem.typename = vendor[0].typename;
lookupItem.name = vendor[0].name;
lookupData[0] = lookupItem;
//Set the value of another custom lookup field on the form
crmForm.all.new_billtovendorid.DataValue = lookupData;
}
No comments:
Post a Comment