You need to sign in to do that
Don't have an account?
Justin Lonis
can anyone help me create a trigger to get "status" to change values (picklist field) from feed comments?
Just looking to have a status change from "Awaiting Customer Feedback" to "Working" when a Feed Comment post is made: A picture of the example is below. Any help would be appreciated!!!
!The top I did in process builder. The highlighted I'm having trouble with.
!The top I did in process builder. The highlighted I'm having trouble with.
Ok thanks for the reply and the below code should solve the issue for you. Thanks!!
All Answers
Once a feed comment post is made, on which object / table do you want the update? Thanks.
So when this comment is made I would like the Case object updated. The field is just "status" the standard SF field. Any thoughts?
Thanks!!
Ok thanks for the reply and the below code should solve the issue for you. Thanks!!
So an example- if I'm an internal user (case owner) and I comment on the feed comment...I would not want it to change from awaiting customer feedback to working.
Any assistance would be grately appreciated!
Thanks,
So I put the following trigger in (I replaced the marketing user ID with another profile ID that should be able to have the status change and it won't change the status for anyone now :(
trigger CommentStatusUpd_906F0000000DA3tIAG on FeedComment (after insert) {
for (FeedComment feedcs : trigger.new){
List<CaseFeed> chkCsFeed = [ SELECT Id FROM CaseFeed WHERE ParentId=: feedcs.ParentId ];
if( chkCsFeed.size() > 0){
system.debug('***DEBUG***'+feedcs.ParentId);
List<Case> Pros = new List<Case>([ SELECT CaseNumber, Id, Status, OwnerId FROM Case WHERE Id =: feedcs.ParentId ]);
for (integer i = 0; i < Pros.size(); i++){
List<User> Usrs = new List<User>([ SELECT ProfileId FROM User WHERE Id=: Pros[i].OwnerId ]);
for (User usrprofile : Usrs) {
if( usrprofile.ProfileId == '00e800000018sx8' ) {
Pros[i].Status = 'Working';
}
}
}
update Pros;
}
}
}
Hi SF Issue-User,
If you want check out this thread....there is some great stuff going on here (a continuation of our conversation on this thread). Can you help close out this issue for me?
https://developer.salesforce.com/forums/ForumsMain?id=906F0000000DBeC