recuperare valore lookup
var lookupitem = new array;
// this will get the lookup for the attribute primarycontactid on the account form.
lookupitem = crmform.all.primarycontactid.datavalue;
// if there is data in the field, show it in a series of alerts.
if (lookupitem[0] != null)
{ // the text value of the lookup.
alert(lookupitem[0].name);
// the guid of the lookup.
alert(lookupitem[0].id);
// the entity type name.
alert(lookupitem[0].typename);
// the entity type code of the lookup: 1=account, 2= contact.
// this attribute is deprecated. use typename instead.
alert(lookupitem[0].type);
}
Sbiancare una lookup:
changeParentAccount();
function changeParentAccount()
{
var customer = new Array;
customer = document.getElementById("parentaccountid");
if (customer.DataValue != null)
{customer.DataValue=null;}
}
DISABILITARE UNA LOOKUP
var lookUpProjectMaster = new Array;
lookUpProjectMaster = document.getElementById("mdb_projectmasterid");