0

I have a after saving flow and I am using update triggering record directly option to update the fields.

enter image description here

Is it good to have this option for after save flow for every decision like below? Because we have multiple update operation in one flow.

enter image description here

1 Answer 1

1

I have seen this is the kind of decision element being used almost most of the places. Though visually it may look same but it will become more complex when the flow grows.

Also you can look above in apex something like this.

if(Some Decision){
    
} else {
    if(Some Decision){

    } else {
        if(Some Decision){

        } else {
            if(Some Decision){

            } else {

            }
        }
    }
}

Which is very bad in terms of good coding practice.

In my view you should go with this kind of decision boxes.

enter image description here

Which in apex will look like this.

if (Some Decision) {

} else if (Some Decision) {

} else if (Some Decision) {

} else if (Some Decision) {

} else {
    
}
        

Which will be more readable and easy to understand.

NOTE : And name your default outcomes and decision boxes properly, so that it is identifiable what decision it should take.

6
  • Here I want to run all the Decisions. Like "execute next criteria" in process builder May 31 at 4:08
  • Technically you can achieve the same via above decision box too. May 31 at 4:10
  • Okay Got it. Is it ok to have multiple update operations in after save or should I update all the records at once? May 31 at 5:40
  • update triggering record directly is selectable for before-save record-triggered flows May 31 at 5:50
  • 1
    You should have only one node for update. Also add conditions before the flow gets triggered. So that it does not cause a recursion. May 31 at 6:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.