SalesForce Action Button Not Passing Variables

cloneprocess-buildervisual-flowsvisual-workflow

I've created a flow to clone Quote and related Quote Line Items (using this as a loose guide).

I'm working in a sandbox environment. When I run 'Debug' in the Flow builder, the flow executes as intended, and a clone is created from the chosen Quote record with related QLIs attached.

My flow is as follows:

flow overview

1. Set screen flow to allow user to choose to clone related QLIs

enter image description here

2. Assign variables

enter image description here

3. Clone the Quote with all record values

enter image description here

4. Assign new Quote ID to new variable

enter image description here

5. Update some fields on the new Quote record so name and status are more accurate – Here setNewQuoteName variable is just random text

enter image description here

6. When 'Yes, Clone' is chosen on the screen flow, grab all related QLI records

enter image description here

7. Loop through each related QLI record that was collected

enter image description here

8. Update the values in each related record grabbed

enter image description here

9. Add each related record to a collection

enter image description here

enter image description here

10. After the last collected QLI has been looped over, create new QLIs related to the newly created quote, using the info stored in the record collection from step #9.

enter image description here

11. Decision – If Use_Variable_for_Cloned_Quote_ID is null or an empty string, return a message that lists values of all variables. Otherwise, return success message with link to new Quote.

  • From the 'Debug' in the flow itself, you can see all variables are being correctly stored and accessed.

enter image description here

The success message even returns the correct url to the newly created quote, and the sandbox environ will show the newly created quote with all related QLIs accurately.

enter image description here

enter image description here

However, running the flow from the action button within the same record used in 'Debug' above, I hit the created error, and the quote and related qlis do not clone:

enter image description here

enter image description here

As you can see, it appears to be an issue with variable access. How can this be fixed?

Best Answer

As mentioned above recordId is case sensitive. Can you try as recordId as variable