Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Customer

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.

Example

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.
   alert(customer[0].name);

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

   // The entity type name of the customer.
   alert(customer[0].typename);

}

See Also

Concepts

Other Resources


© 2010 Microsoft Corporation. All rights reserved.


Show:
© 2015 Microsoft