Dynamics Crm: Get metadata for statuscode/statecode mapping

后端 未结 3 944
没有蜡笔的小新
没有蜡笔的小新 2021-02-13 20:03

In Dynamics CRM 2011, on the Incident entity, the \"Status Reason\" optionset (aka statuscode) is related to the \"Status\" optionset (aka statecode)

e.g. see this scree

3条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-13 20:40

    You already have everything try insert this code inside of foreach:

     int stateOptionValue = (int)((StatusOptionMetadata)optionMeta).State;
    

    See StatusAttributeMetaData.OptionSet.Options hierarchy can return a type called StatusOptionMetadata if you use the State property of the StatusOptionMetadata, it will return the statecode this statuscode belongs to.

提交回复
热议问题