You need to sign in to do that
Don't have an account?
Mohit Halkare 2
Workflow or Process Builder Champions
I need help to create a workflow or process to update one field after checking another field from an Object which is a child of a Grand Parent Object.
Example:-
C is child of B
B is child of A
K is also another Child of A
I need a workflow or process that when C is created, a field in C should be updated from a field in K.
I cannot use formulae as the field in C should be editable later.
Example:-
C is child of B
B is child of A
K is also another Child of A
I need a workflow or process that when C is created, a field in C should be updated from a field in K.
I cannot use formulae as the field in C should be editable later.
Since iteration on multiple records is involved, then there are only 2 approaches that I can think of which will help address your requirement.
Approach 1
- Create a Process Builder on C that fires whenever the respective field value on C is added or modified.
- The process builder should use an Invoke an Apex Class action to invoke an Apex class marked with @Invocable annotation and contains the logic to iterate over multiple records of K associated with A and return the respective field value on K.
- The value returned from Step 2 can then be stamped on the respective field in C.
Approach 2- Write an After Insert / Update Apex Trigger on C which invokes the business logic in Apex to iterate on associated records of K and update the respective field value on C.
One thing you should definitely cosnider is, if A is related to K with a Master Detail relationship and if the field value on associated K records, can be updated on A via a Rollup Summary function i.e. MAX(), MIN(), AVG(), COUNT(), SUM() then you can still use the earlier suggested out of box approach. If not then the above suggested approaches will help you accomplish the requriement.I am afraid that this may not be achieved using declarative artefacts, considering the branched relationship hierarchy of the objects invovled in the transaction. However, you can consider the Rollup Approach stated above which may help.
- Development
- Test Code
- Unit Testing
- Production Deployment
However, this may vary.Please mark this thread as solved if your query has been addressed.