You need to sign in to do that
Don't have an account?
Suresh Raghuram
Set AccountId to null on Case when created by Email to Case
Hello Community,
I had to set Account To NULL when a case is being created by Email to Case future.
Any work around using triggers. Please let me know.
If this is a impossible thing, point me to the right direction .
Thanks,
Suresh.
I had to set Account To NULL when a case is being created by Email to Case future.
Any work around using triggers. Please let me know.
If this is a impossible thing, point me to the right direction .
Thanks,
Suresh.
This can be possible directly from EmailMessage object on After Insert where ParentId is a case Id .
so write trigger on EmailMessage after the finish of the Email to Case process the EmailMessage Object field ParentId will be populated with the CASE ID. Fetch the Id and Query the Case and update it.
All Answers
I did the second half of your explination.
I placed some code in the after Insert on Case and checked the Case Origin and tried to update the AccountId to null but I am getting the following error.
Even after doiing the first part of you explination, I suspect I will run into the same issue.
the Issue is
Subject: Sandbox: Email-to-Case: Error(s) encountered while processing
The following errors were encountered while processing an incoming email:
CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY : CaseTrigger: execution of AfterInsert
caused by: System.NullPointerException: Attempt to de-reference a null object
Correct me if my assumption is wrong.
During the process of Email to Case creation Case is being created by the internal salesforce.
I am not seeing any logs.
This can be possible directly from EmailMessage object on After Insert where ParentId is a case Id .
so write trigger on EmailMessage after the finish of the Email to Case process the EmailMessage Object field ParentId will be populated with the CASE ID. Fetch the Id and Query the Case and update it.