由于CRM 2011 IE10 在线问题,我们决定将所有前端JavaScript 从Soap 转换为oData。一切顺利,我安装了 oData 设计器,将查询集中在函数中,但是当我尝试检索 ServiceActivity 的 partylist 字段 Resources 时遇到了问题。
我使用 oData 查询设计器得到的 oData 查询如下(guid 是示例)
ServiceAppointmentSet?$select=Resources&$filter=ActivityId eq guid'83CA6B11-6C0A-E311-8BB5-B499BAFE71A5'
但在响应中我得到一个错误,指出没有找到 Resources 字段。
我尝试不选择,并调试返回的 oData 对象,但注意到它没有显示 ServiceActivity 中的 Resources 和 Customers partylist 字段。
ServiceAppointmentSet?$filter=ActivityId eq guid'83CA6B11-6C0A-E311-8BB5-B499BAFE71A5'
有没有人有什么想法?
最佳答案
我相信您可以通过使用$expand 允许查询包含serviceappointment_activity_parties来获取Resources 和Customers em>关系。像这样:
ServiceAppointmentSet(guid'83CA6B11-6C0A-E311-8BB5-B499BAFE71A5')?
$select=
serviceappointment_activity_parties/ParticipationTypeMask,
serviceappointment_activity_parties/PartyId
&$expand=serviceappointment_activity_parties
activityparty 的 GUID 可在 PartyId 中找到,ParticipationTypeMask 整数可让您确定它是哪种事件派对,例如 Customer 是 11,Resource 是 10。可以找到 ParticipationTypeMask 映射的完整列表 here .
关于javascript - 如何在 CRM 2011 中使用 Javascript 和 oData 获取 PartyList 字段的值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18397279/