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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

issue in Creating annotation(Notes) with Javascript

(0) ShareShare
ReportReport
Posted on by 7
function abc (executionContext){
 
getting html input file by var html = document.getElementId(/file/);
var case id = window.parent.Xrm.page.data.entity.getId();
var entityname = window.parent.Xrm.page.data.entity.getEntityName();
 
if (entityname == /incident/ && case id != null){
 const html = window.btoa(html);
var data = {
 
/notetext/ : /upload/,
/subject/ : /Upload file/,
/mimetype/ : /application/xlsx/,
/filenameattachment/ : /upload file.xlsx/,
/isdocument/ : true,
/documentbody/ : html,
/objectid_incident@data.bind/ : {
/logicalname/ : /incidents/
/id/ : case id
}
 
};
Xrm.WebApi.createRecord(/annoatation/, data).then(
function success (result) {
alert(result.id);
},
function(error) {
console.log(error.message);
}
   );
}
}
 
 
I have the same question (0)
  • Verified answer
    Dengliang Li Profile Picture
    Microsoft Employee on at
    Hi,
     
    Some parts of your code need to be modified.
     
    In my test, I uploaded a text file to the notes.
     
     
    If my answer was helpful, please click Like, and if it solved your problem, please mark it as verified to help other community members find more.
    If you have further questions, please feel free to contact me .
     
    Best Regards,
    Dengliang Li
     
     
  • Dengliang Li Profile Picture
    Microsoft Employee on at
    Hi,
     
    Has the issue been solved?
    Have there been any updates? Please feel free to ask me if you have any questions!
    If it has been resolved, can you mark the response as an answer?
  • Navin infy Profile Picture
    7 on at
    Hi community member,
     
    Im sorry for late response because of login problem
     
    the issue has not been resolved 
     
    im trying add excel file to annotation not text file 

    im getting error at redline.
     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
11manish Profile Picture

11manish 165

#2
ManoVerse Profile Picture

ManoVerse 156 Super User 2026 Season 1

#3
Zhilan Profile Picture

Zhilan 49

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans