Showing posts with the label Get PickList value with SELECT CRM 2011

Get PickList value for Reports or other SQL statements

There is a table,'StringMap' which contains map of id with value. you can run any select statement against this table.'AttributeValue' takes key and 'value' takes value of the key.You should do some filter actions to focus on to the exact data that we may need so add 'ObjectTypeCode' as type code of Entity and 'AttributeName' as name of the field to the where statement. Example; SELECT AttributeValue,Value FROM StringMap WHERE ObjectTypeCode = '1' and AttributeName='customertypecode' Query will return CustomerTypeCode of Account. There is also alternate, if you do not know type code of the entity; FilteredViewName must be name of the entity with 'Filtered' prefix : Filtered+account. SELECT AttributeValue,Value FROM FilteredStringMap WHERE FilteredViewName= 'Filteredaccount' and AttributeName='customertypecode' query will return same result as above. good luck.