web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Typescript using Xrm.WebApi.retrieveMultipleRecords getting error message

(0) ShareShare
ReportReport
Posted on by 1,532

I am using Typescript and have install the  npm install @types/xrm --save-dev.  Everything seems to be working.

I did my first deploy.   I am getting the following error message on Xrm.WebApi.retrieveMultipleRecords.  Any ideal on what I did wrong.  Do I need to deploy something else.

 

RetreiveMultError.PNG

 

function start() {
    var mydataset = "?$select=new_datatrackingId,new_objectid,OwnerId,new_userid,new_source,new_name,new_customerid";
    mydataset += ",new_udf1,new_udf2,new_udf3,new_udf4,new_udf5,new_udf6,new_udf7,new_udf8,new_udf9,new_udf10,new_udf11,new_udf12,new_udf13,new_udf14,new_udf15,new_udf16&";
    var filter = "$filter=";
    filter += "(CreatedBy/Id eq guid'" + userId + "' ";
    filter += "and new_source eq 'Incident' and statecode/Value eq 0)";
    var options = mydataset + filter;

    Xrm.WebApi.retrieveMultipleRecords("new_datatracking", options).then(
        startCallBack,
        function (error) {
            alert("Error: " + error.message);
        }
    );
}



function startCallBack(results) {
    var audit = results[0];
    $("#iModel").val(audit.new_udf1);
    $("#iCompleteOn").val('');

    $("#iProduct").val(audit.new_udf3);
    $("#iProjectNo").val(audit.new_udf4);
    $("#iAudit").val(audit.new_udf5);

    $("#iULENo").val(audit.new_name);
    $("#iTechnician").val(audit.new_udf6);
    $("#iFileNo").val(audit.new_udf8)
    $("#iSamples").val(audit.new_udf15);
    $("#iEngineer").val(audit.new_udf7);
    $("#iSamplesReceived").val(audit.new_udf10);
    $("#iTechnicianName").val(audit.new_udf13);
    $("#iEngineerName").val(audit.new_udf14);

    $("#form_caseid").val(audit.new_objectid);
}


7776.solution.PNG

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at

    Hi ,

    Which version of dynamics CRM you are using ?

    Please note Xrm.WebApi.retrieveMultipleRecords method released in 9.x version.

  • rthompson Profile Picture
    1,532 on at

    I'm using

    Microsoft Dynamics® CRM 2016

    (8.1.0.359) (DB 8.1.0.359)

    Are there any API for CRM 2016?  I through this would work with 2016.

  • Mohsin Ali Profile Picture
    3,634 on at

    Hi rthompson, please check your version, Xrm.WebApi.retrieveMultipleRecords is applicable to 9.x only.

  • rthompson Profile Picture
    1,532 on at

    I'm using

    Microsoft Dynamics® CRM 2016

    (8.1.0.359) (DB 8.1.0.359)

    Are there any API for CRM 2016?  I through this would work with 2016.

  • Verified answer
    gdas Profile Picture
    50,091 Moderator on at

    You are using old version you can not use this , you can use CRMRestBuilder to make your query instead of Xrm.WebApi

    github.com/.../CRMRESTBuilder

  • Mohsin Ali Profile Picture
    3,634 on at

    It will not work then. For 2016 you can consider following post:

    community.dynamics.com/.../ms-crm-2016-web-api-operations-retrieve-single-or-multiple-records

  • rthompson Profile Picture
    1,532 on at

    Has anyone does anything using this link with Typescript.

    Also, has anyone tried this api

    0247.TypeScript.DefinitelyTyped.PNG

    Or

    0247.TypeScript.DefinitelyTyped.PNG

  • rthompson Profile Picture
    1,532 on at

    I decided to go with this Nuget.  Seems to work great with CRM 2016.

    5621.Xrm.PNG

  • gdas Profile Picture
    50,091 Moderator on at

    Hi,

    Please verify the answers which helps you in the subject mention questions.

  • rthompson Profile Picture
    1,532 on at

    Decided to go with CRMRESETBuilder.  Does work better with my CRM version.

    I also install this APi for Typescript

    Typescript.PNG

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans