Solution
Setting up the sample:
1. Create a form.
2. Add a new form button called "Generate PO" to your form.
3. Attach a workflow to your form. Add two "User action" bubbles to the workflow, connected in a serial fashion, as shown below.
The solution:
1. Return to the form, and open the behavior wizard by clicking on "Edit form behavior".
2. Click on Create a new behavior.
3. In the create behavior page, click on the "Conditional Action Wizard" link in the "Define Behavior" section.
4. In the wizard, you will need to create a new condition. Select the "Session fields" radiobutton. Choose the "Workflow Submission" property, and choose the 2nd workflow bubble (in this example, it is the "Finance Manager" bubble). Please see attached screenshot below.
5. Add the condition to the main list box.
6. In the "Behavior" section, click on the "Create action" button. Choose the "Enable/Disable/Hide/Show form button" action.
7. Specify "Generate PO" as the button name. This should match exactly the caption of the form button you created earlier. Ensure that the visibility field is set to "Yes". You should have the following screen below.
8. Click OK to create this action. You should now have the following screen:
9. Scroll down slightly further. In the "Else behavior" section, click the "Create an action" button. Ensure that the Button name is set to "Generate PO". This time, set the Visibility field to "No". Click OK to save the settings. You should now have the following action created.
10. Click the "Save changes" button to save your changes, and create the behavior by click "Create now" button.
Testing your solution:
1. Run the application & launch the form.
2. You will notice that the "Generate PO" button is initially invisible.
3. Fill up the form and submit it to the workflow. Login as the first approver and approve the request. When it has reached the 2nd bubble, the 2nd approver should be able to see the "Generate PO" button appear at the bottom of the form.
Remarks & Assumptions:
Using this method above, the form button will only show if the form is pending exactly at that bubble. If the user at the 2nd bubble approves and the workflow has completed (or once the workflow has moved on to the next bubble), the form button will disappear again since the active node isn't at the 2nd bubble anymore.
Comments