You need to sign in to do that
Don't have an account?
Mike Schumacher 10
trying triggers on the enhanced notes - insert trigger fires before the note is completed.
I was testing the enhanced notes in our sandbox and i noticed the insert trigger is firing even before I finish typing. As I type some more in the title or note body, the update triggers keep firing. The dynamic saving as the user types is nice but I want to create a trigger to notify a specific group a new note has been added.
If I send the email notification on the insert, the new note is not complete and does not contain all the body text i entered. The user will receive only a partial note.
How do others recommend approaching this situation? I want to be able to capture the title and note body in an email.
Sample Trigger:
trigger Test_ContentDocument_Trigger on ContentDocument (before insert, before update, before delete,
after insert, after update) {
List<ContentDocument> cdRecords = trigger.new;
ContentDocument cdRec = cdRecords[0];
if(Trigger.isBefore && Trigger.isInsert) {
System.debug('....before insert trigger....');
System.debug('......contentdocument:' + cdRec.Title);
}
if(Trigger.isBefore && Trigger.isUpdate) {
System.debug('....before update trigger....');
System.debug('......contentdocument:' + cdRec.Title);
}
if(Trigger.isAfter && Trigger.isInsert) {
System.debug('....before isInsert trigger....');
System.debug('......contentdocument:' + cdRec.Title);
}
if(Trigger.isAfter && Trigger.isUpdate) {
System.debug('....before isUpdate trigger....');
System.debug('......contentdocument:' + cdRec.Title);
}
If I send the email notification on the insert, the new note is not complete and does not contain all the body text i entered. The user will receive only a partial note.
How do others recommend approaching this situation? I want to be able to capture the title and note body in an email.
Sample Trigger:
trigger Test_ContentDocument_Trigger on ContentDocument (before insert, before update, before delete,
after insert, after update) {
List<ContentDocument> cdRecords = trigger.new;
ContentDocument cdRec = cdRecords[0];
if(Trigger.isBefore && Trigger.isInsert) {
System.debug('....before insert trigger....');
System.debug('......contentdocument:' + cdRec.Title);
}
if(Trigger.isBefore && Trigger.isUpdate) {
System.debug('....before update trigger....');
System.debug('......contentdocument:' + cdRec.Title);
}
if(Trigger.isAfter && Trigger.isInsert) {
System.debug('....before isInsert trigger....');
System.debug('......contentdocument:' + cdRec.Title);
}
if(Trigger.isAfter && Trigger.isUpdate) {
System.debug('....before isUpdate trigger....');
System.debug('......contentdocument:' + cdRec.Title);
}
Keaton Klein 13
I've run into the same problem, no suggestions?
Sergei Wallace 11
bump
Mike Schumacher 10
Still do not have any reasonable suggestions. Process Builder does not support the new contentdocument object yet either.