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>'
Advertisements

2 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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s