You need to sign in to do that
Don't have an account?
Rutul Shah
System.UnexpectedException: Note can't be saved
I m getting error of System.UnexpectedException: Note can't be saved while inserting list of content notes like Database.insert(listContent,false)
What can be the issue?
What can be the issue?
I am able to do it Here is below my code I have executed.Please give your sample code or review mine Where is difference?
Thanks
Sandeep Singhal
http://www.codespokes.com/
have a look at my sample code which i tried and m getting the above error on Database.insert
Database.SaveResult[] lsr=null;
List<ContentNote> cntList=new List<ContentNote>();
try {
For(SyncDetail cnote : cnoteDetails){
String newTitle=cnote.getProperty('Title');
String newContent=cnote.getProperty('Content');
ContentNote objTempNote = new ContentNote();
objTempNote.Title =newTitle;
objTempNote.Content = Blob.valueOf(newContent.escapeHTML4());
cntList.add(objTempNote);
}
lsr= Database.insert(cntList, false);
return lsr;
}
catch (Exception e) {
System.Debug('Exception of insertContentNotes: ' + e.getMessage()+' <======> '+e.getStackTraceString());
return lsr;
}