Friday, 12 June 2009

SDK: Customer Regarding

from here: \sdk\client\reference\dom

var lookupItem = new Array;
lookupItem = null;

// This will get the lookup for the attribute regardingobjectid on the Task form.
lookupItem = crmForm.all.regardingobjectid.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);
}

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home