locked
XrmServiceToolkit RetrieveMultiple returning 404 Not Found error RRS feed

  • Question

  • I am using XrmServiceToolkit version 2.2.1 in CRM 2016 and anytime I call this code it's getting a 404 not found error. I used OData query designer and copied the filter and entity name directly from what was generated so the case is correct. Any ideas why this wouldn't work?

     var accountArray = new Array();

         XrmServiceToolkit.Rest.RetrieveMultiple(
                      "New_alt_account_numberSet",
                      "$select=New_AccountNumber&$filter=New_ClientAccountId/Id eq guid'"+sClientAccountGUID+"'",
                      function (results) {
                          if (results.length >= 1)
                          {
                              for (var i = 0; i < results.length; i++) {
                                  accountArray.push(results[i]);
                              }
                          }
                          else
                              return null;
                      },
                      function (error) {
                          alert(error.message);
                      },
                      function onComplete() {
                          //alert(" records should have been retrieved.");
                      },
                      false
                  );

         return accountArray.join(" | ");

     
    Thursday, October 6, 2016 9:15 PM

All replies

  • Hi Ben,

    Recheck the entity name(New_alt_account_numberSet) is correct. It is case sensitive.

    Hope this helps.

    Thanks.

    Friday, October 7, 2016 6:23 AM
  • According to OData Query Designer from the XrmToolBox it is correct. I copied it directly from there into my code. I did think it was odd that OData Query Designer added the "/Id" onto the client account id: New_ClientAccountId/Id
    Friday, October 7, 2016 10:01 AM