我正在尝试通过父实体检索子实体的属性。总帐帐户是父实体,我想要与总帐帐户相关的所有总帐操作实体的详细信息。总帐操作具有到总帐帐户的查找字段。我正在使用ajax和typescript来构建 url 并检索数据。
根据微软文档:
除非您指定较小的页面大小,否则每个请求最多将返回 5000 个实体。如果有更多实体与查询过滤条件匹配,则将在结果中返回 @odata.nextLink 属性。将@odata.nextLink 属性的值与新的GET 请求一起使用以返回下一页数据。
我只返回 1 个父实体和 1 个子实体,所以我不应该遇到这个障碍。然而,
当我使用网址时:
https://crm.com/api/data/v8.0/ccseq_generalledgeraccounts(48513938-7d5a-e711-80e5-005056b33317)/ccseq_generalledgeraccount_ccseq_generalledgeraction_GeneralLedgerAccountID
我得到结果:
{
"@odata.context":"https://crm.com/api/data/v8.0/$metadata#ccseq_generalledgeractions","value":[
{
"@odata.etag":"W/\"676070510\"","_organizationid_value":"ff05a89b-16b0-44a6-879c-26866b3a9d9d","ccseq_servicecode":"111","modifiedon":"2017-06-26T14:41:49Z","ccseq_generalledgernumber":"44000","ccseq_dollar":25.0000,"statecode":0,"ccseq_percent":0.0000000000,"statuscode":1,"_createdby_value":"3b0731e3-52bd-e611-80df-005056b33317","ccseq_jobclasscode":"111","ccseq_companycode":"111","_ccseq_generalledgeraccountid_value":"48513938-7d5a-e711-80e5-005056b33317","ccseq_dollar_base":25.0000,"_modifiedby_value":"3b0731e3-52bd-e611-80df-005056b33317","versionnumber":676070510,"exchangerate":1.0000000000,"ccseq_generalledgeractionid":"3e17f993-7d5a-e711-80e5-005056b33317","ccseq_geographycode":"111","createdon":"2017-06-26T14:41:49Z","_transactioncurrencyid_value":"863aa006-cae5-dc11-92e8-001a6449bbe7","_modifiedonbehalfby_value":null,"_createdonbehalfby_value":null,"utcconversiontimezonecode":null,"timezoneruleversionnumber":null,"importsequencenumber":null,"ccseq_name":null,"overriddencreatedon":null
}
]
}
当我使用网址时:
https://crm.com/api/data/v8.0/ccseq_generalledgeraccounts?$select=ccseq_code&$expand=ccseq_generalledgeraccount_ccseq_generalledgeraction_GeneralLedgerAccountID
我得到结果:
{
"@odata.context":"https://crm.com/api/data/v8.0/$metadata#ccseq_generalledgeraccounts(ccseq_code,ccseq_generalledgeraccount_ccseq_generalledgeraction_GeneralLedgerAccountID)","value":[
{
"@odata.etag":"W/\"676070286\"","ccseq_code":null,"ccseq_generalledgeraccountid":"48513938-7d5a-e711-80e5-005056b33317","ccseq_generalledgeraccount_ccseq_generalledgeraction_GeneralLedgerAccountID":[
],"ccseq_generalledgeraccount_ccseq_generalledgeraction_GeneralLedgerAccountID@odata.nextLink":"https://crminternal.cohencpa.com/COHEN/api/data/v8.0/ccseq_generalledgeraccounts(48513938-7d5a-e711-80e5-005056b33317)/ccseq_generalledgeraccount_ccseq_generalledgeraction_GeneralLedgerAccountID"
}
]
}
我的理解是这两个 url 应该返回完全相同的数据,这将是父子属性的 json 对象。这些查询有什么区别?为什么我的第二个查询返回odata.nextLink
实体的而不是 json 表示?