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 :
Customer experience | Sales, Customer Insights,...
Suggested Answer

How to get Notetext using web services

(0) ShareShare
ReportReport
Posted on by 170

Hi 

 I am trying to get notetext using webservice but I am not getting the data. Any help would be appreciated. Here is my code.

{

  • @odata.context:"">dhhs-misacwis-dev.crm.dynamics.com/.../$metadata,
  • @odata.etag:"W/"6072990"",
  • _mdhhs_caseid_value@OData.Community.Display.V1.FormattedValue:"MiSACWIS",
  • _mdhhs_caseid_value@Microsoft.Dynamics.CRM.associatednavigationproperty:"mdhhs_caseid",
  • _mdhhs_caseid_value@Microsoft.Dynamics.CRM.lookuplogicalname:"mdhhs_workgroup",
  • _mdhhs_caseid_value:"5c933561-616f-ea11-a811-000d3a3bef84",
  • mdhhs_casenumber:"SC-01124-B5J7P3",
  • mdhhs_casestatus@OData.Community.Display.V1.FormattedValue:"In Tier 1 Review",
  • mdhhs_casestatus:394880001,
  • incidentid:"7578af02-5616-4f1a-a7f1-ec47f302e40f",
  • Incident_Annotation:[
      ]

    }

    Regards

    Rupesh

    I have the same question (0)
    • Suggested answer
      Menna El Sayed Galal Profile Picture
      on at

      Hello Rupesh,

      Please have a look to the URL below , and try it and give me your feedback.


      /api/data/v9.1/incidents(7578af02-5616-4f1a-a7f1-ec47f302e40f)?$expand=Incident_Annotation($select=filename,notetext,subject)

    • Rupesh Kumar Gupta Profile Picture
      170 on at

      Hey Sayed,

       I tried that with no luck. Here is my url

      /api/data/v9.1/incidents(7a67827b-4242-4cfb-8a0f-d4a867783647)?$expand=Incident_Annotation($select=filename,notetext,subject)

      I am getting empty Incident_Annotation

      Incident_Annotation:[

      ]

    • Rupesh Kumar Gupta Profile Picture
      170 on at

      result.Incident_Annotation.length is coming as 0. Can you please review and let me know if any mistake is there?

      var req = new XMLHttpRequest();

      req.open("GET", Xrm.Page.context.getClientUrl() + "/api/data/v9.1/incidents(7a67827b-4242-4cfb-8a0f-d4a867783647)?$expand=Incident_Annotation($select=filename,notetext,subject)", true);

      req.setRequestHeader("OData-MaxVersion", "4.0");

      req.setRequestHeader("OData-Version", "4.0");

      req.setRequestHeader("Accept", "application/json");

      req.setRequestHeader("Content-Type", "application/json; charset=utf-8");

      req.setRequestHeader("Prefer", "odata.include-annotations=\"*\"");

      req.onreadystatechange = function() {

         if (this.readyState === 4) {

             req.onreadystatechange = null;

             if (this.status === 200) {

                 var result = JSON.parse(this.response);

                 var incidentid = result["incidentid"];

      alert("Hi-->" + result.Incident_Annotation.length);

                 for (var a = 0; a < result.Incident_Annotation.length; a++) {

             var incident_Annotation_filename = result.Incident_Annotation[a]["filename"];

                     var incident_Annotation_notetext = result.Incident_Annotation[a]["notetext"];

                     var incident_Annotation_subject = result.Incident_Annotation[a]["subject"];

                 }

             } else {

                 Xrm.Utility.alertDialog(this.statusText);

             }

         }

      };

      req.send();

    • Rupesh Kumar Gupta Profile Picture
      170 on at

      I was able to get the value. Thank you.

    • Rupesh Kumar Gupta Profile Picture
      170 on at

      I am able to get subject, notetext and filename but I am not able to get createdby.

      If I pass the annotation id individually I am able to get. Is there any better way?  

    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 > Customer experience | Sales, Customer Insights, CRM

    #1
    Tom_Gioielli Profile Picture

    Tom_Gioielli 70 Super User 2025 Season 2

    #2
    Gerardo Rentería García Profile Picture

    Gerardo Rentería Ga... 33 Most Valuable Professional

    #3
    Daniyal Khaleel Profile Picture

    Daniyal Khaleel 32 Most Valuable Professional

    Last 30 days Overall leaderboard

    Product updates

    Dynamics 365 release plans