We have a custom object, Option, which has apex triggers and process builder field updates. We're now introducing an Invocable apex to be called from the existing process. Two reasons why we need to do this:
- The new calculation is too complex for a process builder to compute
- The new calculation is dependent on the existing calculations performed by the process builder
Within the Invocable method, there's a query on the Option object to refetch the records from the database before proceeding with the calculation. Again, two reasons:
- Unlike a trigger, the process builder will NOT have all the fields for the record/records in context
- I need a new 'instance' of the records anyway since they ones that process builder provides are 'read-only' (I verified by trying to update the instance directly)
Now the question is, if I refetch the records via a SOQL, will they have the fields updated by the process builder actions preceding the Invocable call?
Note: When I cloned the reference passed by process builder, I was able to update the records but I'm trying to find out if pulling from the DB will have the updated fields