如何使用Web API方法从“所有者"类型的CRM数据库中获取“所有者"列?
问题描述:
我正在客户端上使用 Microsoft Dynamics 365-内部.在这里,我在访问其中一个字段-类型为owner
的ownerid
时遇到问题.
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