我正在尝试使用联系表单上的oData
检索多条记录,但它会抛出Bad Request
错误。任何人都可以建议我为什么会这样。
提前致谢
的JScript
// Retrieving multiple connections with accound ID as Record2Id.
function myFunction
{
var contId = Xrm.Page.data.entity.getId();
retrieveMultiple("ConnectionSet", "ConnectionId", "Record2Id eq '" + contId + "'", successCallbackConnections, errorCallbackConnections, true);
}
function successCallbackConnections(data, textStatus, XmlHttpRequest)
{
for(i=0; i < data.length; i++)
{
alert(data[i].RoleName);
}
}
function errorCallbackConnections(XmlHttpRequest, textStatus, errorThrown) {
alert(errorThrown);
}
答案 0 :(得分:4)
试试这个:
function myFunction
{
var contId = Xrm.Page.data.entity.getId();
retrieveMultiple("ConnectionSet", "ConnectionId,Record2Id", "Record2Id/Id eq guid'" + contId + "'", successCallbackConnections, errorCallbackConnections, true);
}
答案 1 :(得分:1)
我认为filter
不见了!!
试试这个:
retrieveMultiple("ConnectionSet", "?$filter=YourAttributeHere eq '" + contId + "'", successCallbackConnections, errorCallbackConnections, true);