Share via


CrmTypes.CreateLookupProperty Method

banner art

Creates an instance of a Lookup attribute represented as a dynamic entity.

Syntax

[Visual Basic .NET]
Public Shared Function CreateLookupProperty(
  ByVal name As String,
  ByVal value As Lookup
) As LookupProperty

[C#]
public static LookupProperty CreateLookupProperty(
  string  name,
  Lookup  value
);

[JScript]
public static function CreateLookupProperty(
  name : String,
  value : Lookup
) : LookupProperty;

Parameters

name

Specifies the name of the attribute.

value

Specifies the value of the attribute.

Return Value

Returns a LookupProperty type.

Example

[C#]
// Set up the CRM Service.
CrmService service = new CrmService();
service.Credentials 
      = System.Net.CredentialCache.DefaultCredentials;

// Create the LookupProperty.
LookupProperty lookupProp 
      = CrmSdk.CrmTypes.CreateLookupProperty(
                "pricelevelid",
                 EntityName.systemuser.ToString(),
                 user.UserId);

See Also

© 2007 Microsoft Corporation. All rights reserved.