You need to sign in to do that
Don't have an account?
jishan roy
Trigger I want to update custom case field when add comment .
my requirement is when i will add comment in case feed comment then in case field which i created (latestComment) show latest comment.
here is my code: for Trigger
trigger latestCommentTrigger on Case (before insert, after update) {
for(Case c : trigger.new) {
if(c.Comments == Null){
c.Comments.adderror('enter comment');
}
c.Comments = c.Latest_Comment__c;
}
}
i didnot getting output of this code can any one help me out of this question.
here is my code: for Trigger
trigger latestCommentTrigger on Case (before insert, after update) {
for(Case c : trigger.new) {
if(c.Comments == Null){
c.Comments.adderror('enter comment');
}
c.Comments = c.Latest_Comment__c;
}
}
i didnot getting output of this code can any one help me out of this question.
As the DML is happening on CaseComment object ( you are inserting a new CaseComment), we need a trigger on CaseComment object. It can be as simple as below ( assuming you don't have any other trigger on CaseComment).
Please try it and let me know how it goes. Thanks!