Topic by Anuj Behl
Content
Hi,
I have an Incident update async CPM which executes through a business rule. The CPM is required to get the latest value of certain Incident fields and send them over to an external system via CURL. One of the field updates that I need to send is associated Contact details.
When an incident field such as Status, Thread etc. is updated and Incident is saved, I can access the latest updated value of these fields and send them to the external system. However, when I update the contact and save the Incident, the Incident record in CPM just cannot get the latest true value of associated contact.
Suppose, a contact A was associated to Incident and I changed it to B. The Incident record in CPM will still give me the value of A. Now, if I change the contact again to C, I will see either A or B. I keep getting random contact ID associated to the Incident, sometimes it's the contact I added a few saves before.
Now, I have tried $incident->PrimaryContact with
- the object instance available to CPM in apply method
- Fetch() the incident record and then access the contact
- Use ROQL to fetch the incident and then access the contact
No matter how I try to get the Contact value, I always get wrong result.
Note: There is no issue when I do NOT run the CPM asynchronously. Since I want to make a call to an external system, I need to run it async.
Did anyone encounter this before? Is it a known issue or a product bug that I am not aware of?
If anyone has any solution to this, please share.
Thanks,
Anuj