function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Angad OberoiAngad Oberoi 

Multiple field updates on the same field in one process, limitation of PB?

Hello!

I am trying to make a process that will check the record for certain conditions, and add points to a new field based on which conditions were met.

So for example,

1st Condition. If Gender is Male --> Update ABC field with 3 points. ([Object__c].ABC__c + 3)
2nd Condition . If City is London --> Update ABC field with 1 points. ([Object__c].ABC__c + 1)

So at the end of these two conditions, the value of field ABC should be 4. However, whenever I run it, it always ends up being just 1. I have checked this several times with more and varied conditions, and it the field ABC always just take the value from the last condition. 

The default value of field ABC is set as 0 so that can't be the problem. Is this a limitation of PB? That the field can only be updated once during a process? Or that the formula always uses the orginal value of the field ABC which existed before the process started?

I even tried building an invocable process for each condition, but the same problem still persists..

Is there any workaround for this? Would really appriciate some help!

Thank you! 



 
Natarajan _Periyasamy__cNatarajan _Periyasamy__c
Hey Angad,

https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_triggers_order_of_execution.htm

Go through the 2nd point from the bottom of the page, this will help you understand how that works.

Regards,
N
Angad OberoiAngad Oberoi
Hi Nartajan, Thanks for the answer! I went through the point and it seems that I was correct in assuming that this is a limitation of PB then, since it does not use the updated value but rather the old value before the update. Is there any way around this? I tried using invocable processes but have the same problem. If not in PB, is there some other tool I can use to achieve the outcome I need? The help is much appreciated!
Natarajan _Periyasamy__cNatarajan _Periyasamy__c
Hi Angad,

This can be easily achieved through triggers Or you can try the same using one invocable process.

Below logic should be in one invocable method

1st Condition. If Gender is Male --> Update ABC field with 3 points. ([Object__c].ABC__c + 3)
2nd Condition . If City is London --> Update ABC field with 1 points. ([Object__c].ABC__c + 1)

Regards,
Natarajan