Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get option set values from sql server in an application outside crm

How to get option set value of an entity from sql server. I have developed a windows application , in which i was getting option set from crm using impersonization. But now my requirement is to get the value from sql server using sql server credentials but not with crm credentials.

like image 497
Maddy Avatar asked Sep 27 '12 04:09

Maddy


2 Answers

select
    e.Name as EntityName,
    e.ObjectTypeCode,
    s.AttributeName,
    s.AttributeValue,
    s.Value,
    s.DisplayOrder
from
    StringMap s 
    inner join EntityLogicalView e on
        s.ObjectTypeCode = e.ObjectTypeCode
where
    e.Name = 'new_entityname'
    and s.AttributeName = 'new_optionsetname'
like image 181
nixjojo Avatar answered Sep 28 '22 06:09

nixjojo


Direct SQL access is obviously unsupported but if you need to grab the info anyway, you need to look at the StringMap view. You can then filter by entity and attribute name as required.

like image 31
glosrob Avatar answered Sep 28 '22 07:09

glosrob