0
votes

I need to fetch a list of phonecall entity records from the MS CRM database.

For that purpise i am using the ODATA Query,

When i use the ODATA query written below,

//hyd1303d/CR8CLTNew/xrmservices/2011/OrganizationData.svc/PhoneCallSet?

it works fine and gives me the results....

But when i try to access the Sender/Recipient of a record, it gives me error:

//hyd1303d/CR8CLTNew/xrmservices/2011/OrganizationData.svc/PhoneCallSet?$select=from,to

Error recieved:

"[HttpWebRequest_WebException_RemoteServer] Arguments: NotFound Debugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See http://go.microsoft.com/fwlink/?linkid=106663&Version=5.1.10411.0&File=System.Windows.dll&Key=HttpWebRequest_WebException_RemoteServer"

Please provide any solution for this.

Thanks in advance.

1
Please use an HTTP tracing tool, for example Fiddler to see the request/response. The response should contain more information about the error (if it really occurred on the server). In any case stack trace of the exception helps identify the problem as well.Vitek Karas MSFT

1 Answers

0
votes

You have to query ActivityPartySet for Sender/Recipient etc. (Full list: http://msdn.microsoft.com/en-us/library/gg328549.aspx)

ie. to retrieve from(sender) of a email/phonecall/letter etc. and set the relevant field on a form you should the following:

result = RetrieveSynchronously("ActivityPartySet?$filter=ActivityId/Id eq guid'" + GuidOfEmailEtc + "' and ParticipationTypeMask/Value eq 1");

if (result != null && result.length > 0) {
  var party = result[0].PartyId;
  var value = [{ id: party.Id, name: party.Name, entityType: party.LogicalName }]

  switch (party.LogicalName) {
      case "account":
          Xrm.Page.getAttribute("new_accountid").setValue(value);
      break;
      case "contact":
         Xrm.Page.getAttribute("new_contactid).setValue(value);
      break;
      default:
      break;
  }
}