Export (0) Print
Expand All
Expand Minimize

SetLocLabels Message (CrmService)

banner art

[Applies to: Microsoft Dynamics CRM 4.0]

Works for all deployment typesWorks online only

Sets the localized labels for the specified attribute.

The relevant classes are specified in the following table.

TypeClass
RequestSetLocLabelsRequest
ResponseSetLocLabelsResponse

Remarks

To use this message, pass an instance of the SetLocLabelsRequest class as the request parameter in the Execute method.

For a list of required privileges, see SetLocLabels Privileges.

Example

The following code example demonstrates how to use the SetLocLabels message.

[C#]
// Set up the CRM Service.
CrmAuthenticationToken token = new CrmAuthenticationToken();
// You can use enums.cs from the SDK\Helpers folder to get the enumeration for Active Directory authentication.
token.AuthenticationType = 0; 
token.OrganizationName = "AdventureWorksCycle";
 
CrmService service = new CrmService();
service.Url = "http://<servername>:<port>/mscrmservices/2007/crmservice.asmx";
service.CrmAuthenticationTokenValue = token;
service.Credentials = System.Net.CredentialCache.DefaultCredentials;

// Create a moniker using an existing account record.
Moniker recordMoniker = new Moniker();

// Use the built-in savedquery record named "My Active Accounts".
// Note: Unlike most Microsoft Dynamics CRM 4.0 record IDs, this record ID is fixed and will never change.
recordMoniker.Id = new Guid("00000000-0000-0000-00aa-000010001001");
recordMoniker.Name = "savedquery";

// Create a US English LocLabel to add to the savedquery "name" attribute.
CrmSdk.LocLabel englishLabel = new CrmSdk.LocLabel();
englishLabel.LanguageCode = new CrmSdk.CrmNumber();
englishLabel.LanguageCode.Value = 1033;
englishLabel.Label = "English| My Active Accounts";

// Create an Arabic LocLabel to add to the savedquery "name" attribute.
CrmSdk.LocLabel arabicLabel = new CrmSdk.LocLabel();
arabicLabel.LanguageCode = new CrmSdk.CrmNumber();
arabicLabel.LanguageCode.Value = 1025;
arabicLabel.Label = "Arabic| My Active Accounts";

// Create the request for loclabels.
SetLocLabelsRequest setLocLabelsRequest = new SetLocLabelsRequest();

// Add the loclabels for the "name" attribute to the entity savedquery.
setLocLabelsRequest.EntityMoniker = recordMoniker;
setLocLabelsRequest.AttributeName = "name";
setLocLabelsRequest.Labels = new CrmSdk.LocLabel[] { englishLabel, arabicLabel };

// Execute the request.
SetLocLabelsResponse setLocLabelResponse = (SetLocLabelsResponse)service.Execute(setLocLabelsRequest);
[Visual Basic .NET]
' Set up the CRM Service.
Dim token As New CrmAuthenticationToken()
' You can use enums.cs from the SDK\Helpers folder to get the enumeration for Active Directory authentication.
token.AuthenticationType = 0
token.OrganizationName = "AdventureWorksCycle";
 
Dim service As New CrmService()
service.Url = "http://<servername>:<port>/mscrmservices/2007/crmservice.asmx";
service.CrmAuthenticationTokenValue = token;
service.Credentials = System.Net.CredentialCache.DefaultCredentials

' Create a moniker using an existing account record
Dim recordMoniker As New Moniker()

' Use the built-in savedquery record named "My Active Accounts"
' NOTE: Unlike most Microsoft CRM 4.0 record ID's, this record ID is fixed and will never change.
recordMoniker.Id = New Guid("00000000-0000-0000-00aa-000010001001")
recordMoniker.Name = "savedquery"

' Create a US English LocLabel to add to the savedquery "name" attribute
Dim englishLabel As New CrmSdk.LocLabel()
englishLabel.LanguageCode = New CrmSdk.CrmNumber()
englishLabel.LanguageCode.Value = 1033
englishLabel.Label = "English| My Active Accounts"

' Create an Arabic LocLabel to add to the savedquery "name" attribute
Dim arabicLabel As New CrmSdk.LocLabel()
arabicLabel.LanguageCode = New CrmSdk.CrmNumber()
arabicLabel.LanguageCode.Value = 1025
arabicLabel.Label = "Arabic| My Active Accounts"

' Create the request for loclabels
Dim setLocLabelsRequest As New SetLocLabelsRequest()

' Add the loclabels for the "name" attribute to the entity savedquery
setLocLabelsRequest.EntityMoniker = recordMoniker
setLocLabelsRequest.AttributeName = "name"
setLocLabelsRequest.Labels = New CrmSdk.LocLabel() { englishLabel, arabicLabel }

' Execute the request
Dim setLocLabelResponse As SetLocLabelsResponse = CType(service.Execute(setLocLabelsRequest), SetLocLabelsResponse)

See Also

Concepts

Reference


© 2010 Microsoft Corporation. All rights reserved.


Show:
© 2014 Microsoft