How to query CRM Global OptionSet Values in SQL?

Use the below select query to get the Global OptionSet values in SQL,

SELECT OS.NAME, L.LABEL, AV.VALUE FROM ATTRIBUTEPICKLISTVALUEASIFPUBLISHEDLOGICALVIEW AV
JOIN OPTIONSETASIFPUBLISHEDLOGICALVIEW OS
ON AV.OPTIONSETID = OS.OPTIONSETID
JOIN LOCALIZEDLABELASIFPUBLISHEDLOGICALVIEW L
ON L.OBJECTID = AV.ATTRIBUTEPICKLISTVALUEID
WHERE OS.ISGLOBAL = 1 AND OS.ISCUSTOMOPTIONSET = 1
AND L.OBJECTCOLUMNNAME = 'DISPLAYNAME'
AND OS.NAME ='<Provide Global OptionSet Schema Name>'
Advertisement

3 thoughts on “How to query CRM Global OptionSet Values in SQL?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.