Reputation: 731
I am trying to retrieve multiple records using oData
on Contact form but it's throwing Bad Request
error. Can anyone suggest me why it's happening.
Thanks in advance
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);
}
Upvotes: 4
Views: 693
Reputation: 27659
I think filter
is missing!!
Try this:
retrieveMultiple("ConnectionSet", "?$filter=YourAttributeHere eq '" + contId + "'", successCallbackConnections, errorCallbackConnections, true);
Upvotes: 1
Reputation: 4585
Try this:
function myFunction
{
var contId = Xrm.Page.data.entity.getId();
retrieveMultiple("ConnectionSet", "ConnectionId,Record2Id", "Record2Id/Id eq guid'" + contId + "'", successCallbackConnections, errorCallbackConnections, true);
}
Upvotes: 4