You need to sign in to do that
Don't have an account?
José Carlos Lorenzale
Change RelatedToId from Email Message
Hello!
There is a process in my client's daily routine which requires the possibilty to modify the RelatedToId from an Email Message to change the related Case. ¿Is there a way of achieving this? ¿How would a possible trigger be like?
Thank in advanced.
There is a process in my client's daily routine which requires the possibilty to modify the RelatedToId from an Email Message to change the related Case. ¿Is there a way of achieving this? ¿How would a possible trigger be like?
Thank in advanced.
trigger CambiarRelatedToId on EmailMessage (after update) {
for(EmailMessage emsg: trigger.new){
if (emsg.mc_Input_a_relacionar__c != null) {
emsg.RelatedToId = emsg.mc_Input_a_relacionar__c;
}
}
}
But I get the following error:
CambiarRelatedToId: execution of AfterUpdate caused by: System.FinalException: Record is read-only Trigger.CambiarRelatedToId: line 7, column 1
Review the following errors
You cannot edit this field
Review the following fields
Related To ID
Maybe using the api of the new feature Merge Cases?
Greetings to you!
Email fields, including RelatedToId, can only be changed when the email is in draft status. There's an idea which is active on the success community with a similar discussion for which you can upvote so that it gets available in the future.
https://success.salesforce.com/ideaView?id=0873A0000003aloQAA
https://success.salesforce.com/ideaView?id=0873A000000lKp6QAE
I hope it helps you.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.
Thanks and Regards,
Khan Anas