CrmTypes.CreateLookup Method
![]() |
Creates an instance of a Lookup attribute.
Syntax
[Visual Basic .NET]
Public Shared Function CreateLookup(
ByVal type As String,
ByVal value As Guid
) As Lookup
[C#]
public static Lookup CreateLookup(
string type,
Guid value
);
[JScript]
public static function CreateLookup(
type : String,
value : Guid
) : Lookup;
Parameters
type
Specifies the schema name of the entity to create.
value
Specifies the value of the attribute.
Return Value
Returns a Lookup type.
Example
[C#]
// Set up the CRM Service.
CrmService service = new CrmService();
service.Credentials = System.Net.CredentialCache.DefaultCredentials;
// Create the Lookup attribute.
Lookup lookup
= CrmSdk.CrmTypes.CreateLookup(
EntityName.systemuser.ToString(),
user.UserId);
See Also