• Austin Lewis 12
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 7
    Replies
I am entirely new to APEX and a novice to coding in general. I have a apex trigger on the ContentDocumentLink object that calls a flow, but I am unable to get the trigger to fire on udpates as well as inserts. Here is my trigger below


trigger SaveNote on ContentDocumentLink (before insert, before update, after insert) {
 IF(Trigger.isBefore){
    IF(Trigger.isInsert){
      ContentDocumentLink [] newnote=Trigger.new;
      mySaveNote.SaveNote(newnote);
      }
    IF(Trigger.isUpdate){
      ContentDocumentLink [] newnote=Trigger.new;
      mySaveNote.SaveNote(newnote);
    }
   }
}

Here is my class

public class mySaveNote {
public static void SaveNote (ContentDocumentLink [] newnote){
    for(ContentDocumentLink n: newnote){
    Map<String, Object> params = new Map<String, Object>();
    params.put('ContentDocumentLinkID',n.Id);
    
    Flow.Interview.CCOF_Note_Create_and_Udpate CCOF_Note_Create_and_UdpateFlow = new Flow.Interview.CCOF_Note_Create_and_Udpate(params);
    CCOF_Note_Create_and_UdpateFlow.start();
    }
}
}

 
I am entirely new to APEX and a novice to coding in general. I have a apex trigger on the ContentDocumentLink object that calls a flow, but I am unable to get the trigger to fire on udpates as well as inserts. Here is my trigger below


trigger SaveNote on ContentDocumentLink (before insert, before update, after insert) {
 IF(Trigger.isBefore){
    IF(Trigger.isInsert){
      ContentDocumentLink [] newnote=Trigger.new;
      mySaveNote.SaveNote(newnote);
      }
    IF(Trigger.isUpdate){
      ContentDocumentLink [] newnote=Trigger.new;
      mySaveNote.SaveNote(newnote);
    }
   }
}

Here is my class

public class mySaveNote {
public static void SaveNote (ContentDocumentLink [] newnote){
    for(ContentDocumentLink n: newnote){
    Map<String, Object> params = new Map<String, Object>();
    params.put('ContentDocumentLinkID',n.Id);
    
    Flow.Interview.CCOF_Note_Create_and_Udpate CCOF_Note_Create_and_UdpateFlow = new Flow.Interview.CCOF_Note_Create_and_Udpate(params);
    CCOF_Note_Create_and_UdpateFlow.start();
    }
}
}

 
Hi All,

I want copy ContentNote Content to Case Description field. Here, Description is Text Area data type and Content filed data type is base64.

Problem: How can I copy Content field to Description field with images and text as it is?

When I am using trigger on ContentDocumentLink able to get the fields, but not able to copy as expected format. Some different value is coming when I did copy in trigger.

Thanks in Advance! :)

Regards
Venkat.