locked
crmsvcutil.exe generates UnknownLabel OptionSets RRS feed

  • Question

  • Hi,

    crmsvcutil.exe generates UnknownLabel OptionSets if the language in crm is not english per default. It´s german.

    Can I enable support other languages in crmsvcutil.exe or enter the label for en-EN and de-DE when I create the OptionSet elements ?

    Kind Regards
    Markus


    • Edited by Markus Benz Saturday, December 14, 2013 3:03 AM
    Saturday, December 14, 2013 3:01 AM

All replies

  • Even i have the same question.

    If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"

    Monday, December 16, 2013 12:26 PM
  • Did you find already a solution for this problem ?
    • Edited by Markus Benz Wednesday, January 22, 2014 8:15 AM
    Wednesday, January 22, 2014 8:15 AM
  • Hi Markus,

    Technically, you can. But there's no supported option. You must customize the generate code yourself.

    Here's the way:

    1. Go to your GeneratePicklistEnums project in SDK (\sdk\samplecode\cs\crmsvcutilextensions\generatepicklistenums)

    2. Open your project --> NamingService.cs file.

    3. Modify following method to get your DE language, not EN language.

    public String GetNameForAttribute(
                EntityMetadata entityMetadata, AttributeMetadata attributeMetadata,
                IServiceProvider services)
            {
                return DefaultNamingService.GetNameForAttribute(
                    entityMetadata, attributeMetadata, services);
            }
    
            public String GetNameForEntity(
                EntityMetadata entityMetadata, IServiceProvider services)
            {
                return DefaultNamingService.GetNameForEntity(entityMetadata, services);
            }
    
            public String GetNameForEntitySet(
                EntityMetadata entityMetadata, IServiceProvider services)
            {
                return DefaultNamingService.GetNameForEntitySet(entityMetadata, services);
            }
    
            public String GetNameForMessagePair(
                SdkMessagePair messagePair, IServiceProvider services)
            {
                return DefaultNamingService.GetNameForMessagePair(messagePair, services);
            }
    
            /// <summary>
            /// Handles building the name for an Option of an OptionSet.
            /// </summary>
            public string GetNameForOption(OptionSetMetadataBase optionSetMetadata,
                OptionMetadata optionMetadata, IServiceProvider services)
            {
                var name = DefaultNamingService.GetNameForOption(optionSetMetadata,
                    optionMetadata, services);
                Trace.TraceInformation(String.Format("The name of this option is {0}",
                    name));
                name = EnsureValidIdentifier(name);
                name = EnsureUniqueOptionName(optionSetMetadata, name);
                return name;
            }

    How to implement thoes methods? Use a decompiler and check how DefaultNamingService does and implemented it by yourself.

    Hope it helps.

    Wednesday, January 22, 2014 8:45 AM