locked
How to retrieve Global Option Set metadata from DB RRS feed

  • Question

  • Hi, I have use the GlobalOptionSet metadata for a ssrs reporting need. Can someone please help how to get the GlobalOptionSet metadata information from the database using SQL query? I need to extract the Label and Values for the globaloptionset.

    I am using CRM 2015.

    Thanks,




    • Edited by CRMAdmirer Saturday, September 19, 2015 12:51 PM
    Saturday, September 19, 2015 12:36 PM

Answers

  • Hi,

    You can use the below query to get GlobalOptionSet values and Labels.

    select v.Value, l.Label
    
    from MetadataSchema.AttributePicklistValue v
    
    inner join MetadataSchema.LocalizedLabel l on v.AttributePicklistValueId = l.ObjectId and l.ObjectColumnName = 'DisplayName'
    
    inner join MetadataSchema.OptionSet o on v.OptionSetId = o.OptionSetId
    
    where o.name = 'logicalnameofGlobalOptionSet'



    If you find this post helpful then please Vote as Helpful and Mark As Answer. Thanks and Regards, Polat Aydın My blog

    • Proposed as answer by Polat Aydın[MCP] Monday, September 21, 2015 9:43 AM
    • Marked as answer by CRMAdmirer Monday, September 21, 2015 2:00 PM
    Monday, September 21, 2015 9:16 AM

All replies

  • Hello,

    Have you tried to fetch FilteredStringMap view?


    Dynamics CRM MVP
    My blog

    Monday, September 21, 2015 7:38 AM
    Moderator
  • Hi,

    You can use the below query to get GlobalOptionSet values and Labels.

    select v.Value, l.Label
    
    from MetadataSchema.AttributePicklistValue v
    
    inner join MetadataSchema.LocalizedLabel l on v.AttributePicklistValueId = l.ObjectId and l.ObjectColumnName = 'DisplayName'
    
    inner join MetadataSchema.OptionSet o on v.OptionSetId = o.OptionSetId
    
    where o.name = 'logicalnameofGlobalOptionSet'



    If you find this post helpful then please Vote as Helpful and Mark As Answer. Thanks and Regards, Polat Aydın My blog

    • Proposed as answer by Polat Aydın[MCP] Monday, September 21, 2015 9:43 AM
    • Marked as answer by CRMAdmirer Monday, September 21, 2015 2:00 PM
    Monday, September 21, 2015 9:16 AM
  • Thanks Polat. You are awesome.
    Monday, September 21, 2015 2:01 PM
  • Thanks Polat. You are awesome.

    Try to publish that report and run it under user that doesn't have sys admin role. You will see that this would not work.

    Dynamics CRM MVP
    My blog

    Monday, September 21, 2015 3:38 PM
    Moderator