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

    • Rupesh Kumar Gupta Profile Picture
      170 on at
      RE: How to get Notetext using web services

      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?  

    • Rupesh Kumar Gupta Profile Picture
      170 on at
      RE: How to get Notetext using web services

      I was able to get the value. Thank you.

    • Rupesh Kumar Gupta Profile Picture
      170 on at
      RE: How to get Notetext using web services

      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
      RE: How to get Notetext using web services

      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:[

      ]

    • Suggested answer
      Menna El Sayed Galal Profile Picture
      on at
      RE: How to get Notetext using web services

      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)

    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

    🌸 Community Spring Festival 2025 Challenge Winners! 🌸

    Congratulations to all our community participants!

    Adis Hodzic – Community Spotlight

    We are honored to recognize Adis Hodzic as our May 2025 Community…

    Kudos to the April Top 10 Community Stars!

    Thanks for all your good work in the Community!

    Leaderboard > Customer experience | Sales, Customer Insights, CRM

    #1
    Daivat Vartak (v-9davar) Profile Picture

    Daivat Vartak (v-9d... 225 Super User 2025 Season 1

    #2
    Muhammad Shahzad Shafique Profile Picture

    Muhammad Shahzad Sh... 97

    #3
    Vahid Ghafarpour Profile Picture

    Vahid Ghafarpour 82 Super User 2025 Season 1

    Overall leaderboard

    Product updates

    Dynamics 365 release plans