Maddy
Maddy

Reputation: 263

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.

Upvotes: 6

Views: 5988

Answers (2)

nixjojo
nixjojo

Reputation: 617

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'

Upvotes: 11

glosrob
glosrob

Reputation: 6715

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.

Upvotes: 3

Related Questions