Skip to main content
Microsoft Dynamics CRM forum
Answered

issue in Creating annotation(Notes) with Javascript

editSubscribe (0) ShareShare
ReportReport
Posted on by 2
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);
}
   );
}
}
 
 
Attachments
  • Navin infy Profile Picture
    Navin infy 2 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.
     
  • Dengliang Li Profile Picture
    Dengliang Li 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?
  • Verified answer
    Dengliang Li Profile Picture
    Dengliang Li 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
     
     

Helpful resources

Quick Links

New Blog Features Released!

Check out the new community blog features for viewers and authors…

Setting Up Knowledge Sources for Copilot…

Look at how configuring a comprehensive knowledge base is crucial…

Demystifying Copilot with Georg Glantschnig…

Industry experts answer burning questions directly from our amazing Community…

Leaderboard

#1
Andre Arnaud de Calavon Profile Picture

Andre Arnaud de Cal... 283,126 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 222,646 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,138

Featured topics

Product updates

Dynamics 365 release plans