web
You’re offline. This is a read only version of the page.
close
Skip to main content
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
    issue in Creating annotation(Notes) with Javascript
    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
    issue in Creating annotation(Notes) with Javascript
    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
    issue in Creating annotation(Notes) with Javascript
    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

Responsible AI policies

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

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
MVP-Daniyal Khaleel Profile Picture

MVP-Daniyal Khaleel 117

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 117 Super User 2025 Season 2

#3
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 83

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans