4

我正在尝试使用oData联系表单检索多条记录,但它抛出Bad Request错误。谁能建议我为什么会这样。

提前致谢

脚本

// 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);
}
4

2 回答 2

4

尝试这个:

function myFunction
{
    var contId = Xrm.Page.data.entity.getId();

    retrieveMultiple("ConnectionSet", "ConnectionId,Record2Id", "Record2Id/Id eq guid'" + contId + "'",    successCallbackConnections, errorCallbackConnections, true);
}
于 2013-02-15T11:14:33.183 回答
1

我觉得filter不见了!!尝试这个:

retrieveMultiple("ConnectionSet", "?$filter=YourAttributeHere eq '" + contId + "'", successCallbackConnections, errorCallbackConnections, true);
于 2013-02-15T10:54:42.643 回答