如何使用Web API方法从“所有者"类型的CRM数据库中获取“所有者"列? [英] How to get 'ownerid' column from CRM database of type `owner` using Web API approach?

查看:172
本文介绍了如何使用Web API方法从“所有者"类型的CRM数据库中获取“所有者"列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在客户端上使用 Microsoft Dynamics 365-内部.在这里,我在访问其中一个字段-类型为ownerownerid时遇到问题.

I'm using Microsoft dynamics 365 - on premises of my client. Here, I am facing an issue in accessing one of the fields - ownerid of type owner.

我正在使用Web API方法访问CRM数据.当我在URL中命中查询时,它将带除ownerid列之外的所有数据.

I am using Web API approach to access the CRM data. When I hit the query in URL, it brings all the data except ownerid column.

它的field type是:Simple

有人用WebAPI查询方法遇到相同的问题吗?

Has anyone faced the same issue with WebAPI query approach?

URL查询:

https://baseURL/moves?$select=moveid,ownerid,movenumber&$filter=movenumber%20eq%20%27236659%27

输出:

{
  "@odata.context":"https://baseURL/$metadata#moves(moveid,ownerid,movenumber)","value":[
    {
      "@odata.etag":"W/\"37655223\"","moveid":"4583b2fe-83d9-e611-80c7-369e029457bb","movenumber":"236659"
    }
  ]
}

推荐答案

我认为ownerid是一个查找,因此您需要首先使用$expand查询参数将其扩展,以将其包含在响应中.

I think ownerid is a lookup, so you need to expand it first by using $expand query parameter, to be included in the response.

https://baseURL/moves?$expand=ownerid&$select=moveid,ownerid,movenumber&$filter=movenumber%20eq%20%27236659%27

参考: https://docs.microsoft.com/zh-cn/aspnet/web-api/overview/odata-support-in-aspnet-web-api/using-select-expand和值

这篇关于如何使用Web API方法从“所有者"类型的CRM数据库中获取“所有者"列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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