Collapse the table of content
Expand the table of content
The document is archived and information here might be outdated


banner art

[Applies to: Microsoft Dynamics CRM 4.0]

Find the latest SDK documentation: CRM 2015 SDK

A Customer field represents a type of Lookup where either an account or contact is a valid type of record. The following properties are available:

Customer or Regarding propertiesTypeDescription
{Field}.DataValue Specifies an array of lookup objects. For the Customer field this array always has a length of one. DataValue is Null when no value is selected. Set DataValue to Null to make the lookup field blank.


The following code example shows how to use a Customer field type.

var customer = new Array();
customer = null;

// This gets the lookup for the attribute customerid on the Opportunity form.
customer = crmForm.all.customerid.DataValue;

// If there is data in the field, show it in a series of alerts.
if (customer[0] != null)
   // The name of the customer.

   // The GUID of the customer.
   alert(customer [0].id);

   // The entity type name of the customer.


See Also


Other Resources

© 2010 Microsoft Corporation. All rights reserved.

© 2016 Microsoft