trigger createFeedComment on case(after insert)
{
FeedComment fc = new FeedComment();
fc.CommentBody = 'It is the test comment after creating the case.';
fc.Status = 'Published';
fc.CommentType = 'ContentComment';
insert fc;
}
trigger createFeedComment on case(after insert)
{
case cs = [select id, accountId,contactId from case where accountId!=null OR contactId!=null limit 1];
FeedItem fi = new FeedItem();
if(cs.accountId != null)
{
fi.Body = 'It is the test feedItem comment after creating the case.';
fi.Status = 'Published';
fi.ParentId= cs.accountId;
insert fi;
}
else if(cs.ContactId != null)
{
fi.Body = 'It is the test feedItem comment after creating the case.';
fi.Status = 'Published';
fi.ParentId= cs.contactId;
insert fi;
}
FeedComment fc = new FeedComment();
fc.CommentBody = 'It is the test comment after creating the case.';
fc.Status = 'Published';
fc.CommentType = 'ContentComment';
fc.FeedItemId = fi.id;
insert fc;
}
您可以通过在case对象上触发来满足您的要求。
我在这里举一个例子来了解编码思想-
上面的触发器是在自动创建案例后创建提要注释。
如需更多帮助,请随时询问。
希望以上解决方案对您有所帮助。如果是这样,也请标记为“最佳答案”以帮助他人。
谢谢并恭祝安康,
阿杰·杜贝迪(Ajay Dubedi)
www.ajaydubedi.com
尝试这些代码行,这将对您有所帮助。
希望以上解决方案对您有所帮助。如果是这样,也请标记为“最佳答案”以帮助他人。
谢谢并恭祝安康,
阿杰·杜贝迪(Ajay Dubedi)
www.ajaydubedi.com
这段sql是什么意思能,我要的是我当前创建的case下面新增评论。非常感谢您的回复,但这都不是我想要的结果,谢谢