如何检索实体中查找的格式化值? [英] How to retrieve formatted values of lookups in an entity?

查看:53
本文介绍了如何检索实体中查找的格式化值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用Web API获取实体中可用的查询格式值方面,我们面临着挑战.

We are facing challenge in getting formatted values of lookups available in an entity using web api.

场景:我们有一个包含8个查询的实体.当我使用Web API查询那些对象时,获取那些查找的GUID,而不是那些查找的名称.

Scenario: we have an entity with 8 lookups. When I'm querying those with Web API, getting GUIDs of those lookups, but not the names of those lookups.

推荐答案

将为您提供格式化值-名称,逻辑名称以及ID,如下所示:(无需再次调用)

MSDN says adding header in web api request Prefer: odata.include-annotations="*" will result you the formatted value - Name, logical name along with Id like below: (without making another call)

req.setRequestHeader("Prefer", "odata.include-annotations=\"*\"");

-

   "_customerid_value@Microsoft.Dynamics.CRM.associatednavigationproperty":"customerid_contact",
   "_customerid_value@Microsoft.Dynamics.CRM.lookuplogicalname":"contact",
   "_customerid_value@OData.Community.Display.V1.FormattedValue":"Susanna Stubberod (sample)",
   "_customerid_value":"7ddd0b31-ed8b-e511-80d2-00155d2a68d4",

这篇关于如何检索实体中查找的格式化值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆