You need to sign in to do that
Don't have an account?

Pull ContentNotes using APEX/SOQL
I have a requirement to share a note with multiple accounts. My first issue I was trying to solve is being able to store the notes data in variables then create new records based off that data. I have a trigger on ContentDocumentLink that passes info off to a class.
Problem is, if I save the note before it auto saves, everything works. If I let the record auto save, I dont get the body of the note.
Problem is, if I save the note before it auto saves, everything works. If I let the record auto save, I dont get the body of the note.
trigger trasnferNotes on ContentDocumentLink (after insert) { string relatedID; String documentID; //Get the current ID for the note if (Trigger.isAfter) { if (Trigger.isInsert) { for(ContentDocumentLink cdl : Trigger.New) { relatedID = cdl.LinkedEntityId; documentID = cdl.ContentDocumentId; transferNotesClass db = new transferNotesClass(relatedID, documentID); } } } }
global class transferNotesClass { global String noteID; global String contentDocumentID; global String cvID; global transferNotesClass(String relatedID, String documentID) { try { noteID = relatedID; contentDocumentID = documentID; System.debug('Class Note ID: ' + noteID); //Getting the ID from ContentVersion List<ContentVersion> cv = New List<ContentVersion>([select id from ContentVersion where ContentDocumentId = :contentDocumentID]); for(ContentVersion cv1 : cv) { cvID = cv1.Id; } //Getting the Content Note by passing the above ID to ContentNote List<ContentNote> contNote = New List<ContentNote>([select Content, ContentSize, CreatedById, CreatedDate, FileExtension, FileType, Id, IsDeleted, IsReadOnly, LastModifiedById, LastModifiedDate, LastViewedDate, LatestPublishedVersionId, OwnerId, SharingPrivacy, TextPreview, Title from ContentNote where LatestPublishedVersionId = :cvID]); for(ContentNote contNote1 : contNote) { Blob contentBlob = contnote1.Content; String contentString = contentBlob.toString(); List<String> csvFileLines= contentString.split('\n'); system.debug(csvFileLines); System.debug('Note Title: ' + contNote1.Title); //System.debug('Note Content: ' + csvFileLines); } } catch(DmlException e) { System.debug('The following exception has occurred: ' + e.getMessage()); } } }
- When you say share a note with multiple accounts, how do you know which accounts should the note be shared with and which ones should not? Is there a specific criteria mentioned?
- Quote: "I was trying to solve is being able to store the notes data in variables..." - Assuming that there is a separate object being used to store these notes, why would it be necessary to separate its contents into other variables. I assume the best way would be to clone each note and then associate the new cloned notes to the multiple accounts that need it. I apologize if I misunderstood what you meant
Cute CUT Mod Apk (https://cloneapk.com/cute-cut-mod-video-editor-apk-download-latest-version/)
Avast Battery Saver Pro Mod Apk 2020 (https://cloneapk.com/avast-battery-saver-pro-apk/)
Mega Photo Pro Mod Apk 2020 (https://cloneapk.com/mega-photo-pro-mod-apk-download-latest-version/)
trusted by a large number of students.aftr neet 2020 exam mcc going to conduct mbbs bds counselling ( https://cbseneet2019.co.in/mbbs-bds-counselling/ ) for the mbbs admissiopn in india .
Check out this post for better understanding: ExactlyHowLong (https://exactlyhowlong.com/how-long-to-learn-c-after-python-and-why/)
https://modapkfile.com/fortnite-mod-apk-unlimited-v-bucks-ios/
https://modapkfile.com/
https://modapkfile.com/pubg-mobile-mod-apk-hack-download-iphone/