Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 79901

Creating a Global OptionSet via the SDK

$
0
0

Hi,

I have the following code which allows me to create an OptionSet and within it I have multiple languages tied to it.  I would have thought that when I do this, CRM would display which options to display in the optionset based on the locale currently assigned to the user.

However, this does not seem to be the case, which does make sense because in the configuration my Id's would be different.  Is there a true way to create an optionset which supports multilingual languages without having to crack open XML files?

The code...

OptionSetMetadata option = new OptionSetMetadata();

option.Name = optionSetName;
option.OptionSetType = OptionSetType.Picklist;

option.IsGlobal = true;
option.Description = new Label("Some Eng Description", _EnglishLanguageCode);
option.Description = new Label("Some French Description", _FrenchLanguageCode);
option.DisplayName = new Label("Test English Set", _EnglishLanguageCode);
option.DisplayName = new Label("Test French Set", _FrenchLanguageCode);
option.Options.Add(new OptionMetadata(new Label("Test 1", _EnglishLanguageCode), null));
option.Options.Add(new OptionMetadata(new Label("Test 1 - FRE", _FrenchLanguageCode), null));
option.Options.Add(new OptionMetadata(new Label("Test 2", _EnglishLanguageCode), null));
option.Options.Add(new OptionMetadata(new Label("Test 2 - FRE", _FrenchLanguageCode), null));

When accessed in either French or English locales, all four items show up.

Thanks


Viewing all articles
Browse latest Browse all 79901

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>