是否可以使用$expand
但不返回对象集合,只返回对象的数量?
例如,在单个 WebApi 调用中获取帐户及其注释计数
我已经尝试了几件事。
明显的尝试:
accounts(6CDEEB72-2AC8-E711-A825-000D3AE0A7F8)?$select=name&$expand=Account_Annotation($count=true)
返回所有注释的所有字段,但不计算任何内容。接下来我尝试
accounts(6CDEEB72-2AC8-E711-A825-000D3AE0A7F8)?$select=name&$expand=Account_Annotation($select=annotationid&$count=true)
返回错误:“找到不平衡的括号表达式”。我认为这&与$expand
我发现一个非 crm 博客说这可以用 a 解决,;但是当我尝试
accounts(6CDEEB72-2AC8-E711-A825-000D3AE0A7F8)?$select=name&$expand=Account_Annotation($select=annotationid;$count=true)
时它没有给出错误,但$count
指令似乎被忽略了accounts(6CDEEB72-2AC8-E711-A825-000D3AE0A7F8)?$select=name&$count=Account_Annotation($select=annotationid)
返回“无效计数”错误的疯狂尝试
我猜这不是一个有效的组合,但我想我会在这里发帖,以防其他人成功实现这一目标。