Show 

Home > Workflow Designer > Workflow Example Setup > Sample Workflow Setup 2

Sample Workflow Setup 2

This section explains how to set up a workflow that sets a different control as Active based on a database field value of a searched-for customer when the user clicks a specific button.

 

For this example, when the user clicks the Update button, the Individual Update page must display when the customer’s Record Type is “I” (individual) and the Company update page must display when the customer’s Record Type is not “I.”

To create Sample Setup 2:

1.    On the Customer Update form, within the Detail Page > Start page, place a text box binded to RecordType with the Visible property set to “False.”
16_record_type_props.png

2.    Set the RecordType’s ValueWorkflowEnable property to “True.”
This ensures you can create the Decision Rule based on this control’s value.
17_record_type_wf_prop.png

3.    Set the ControlWorkflowEnable property for the following pages to “True.”
This ensures both pages appear as options to set the controls to Active.

a.    Individ Update

b.    Company Update

4.    Click the Update Now button.

5.    Click the (...) button next to the OnClick property.
The Available Workflows window displays.
05_workflow_list00002.png

6.    Click Add.
The Workflow Designer opens with a new workflow file.
18_blank_canvas00003.png

7.    Drag the Decision icon onto the workflow.
19_decision_dragged00004.png

8.    Right-click the Decision icon and select Edit Workflow.
20_edit_decision00005.png
The Edit Rule window displays.
21_Edit_Rule_window00006.png

9.    Click the [build condition] link.
A drop-down of options appear including those you set ValueWorkflowEnable as “True.”

10.  Select Record Type.
22_select_record_type.png
“Record Type” appears in the rule sentence.

11.  Click the (...) link.

12.  Under the Compare section of the drop-down values, select “is equal to.”
23_select_equal_to.png

13.  Click the [value] link.

14.  Type “I” and click Enter.
The final rule sentence should appear as below.
24_record_type_rule.png

15.  Click OK.
The Edit Rule window closes.

16.  Drag the Set Active Control onto the YES line of the workflow beneath the Decision icon.
25_drag_active_icon.png

17.  Right-click the Set Active Control icon and select Edit Workflow.
The Edit Rule window displays with a sentence already started.

18.  Click “Name of the control to set visible attribute on.”
The controls you set the ControlWorkflowEnable property to “True” appear in the list.

19.  Select IndividUpdate.
26_select_Individ_page.png

20.  Click OK.
This ensures that when the user clicks the Update button and the customer’s Record Type is “I,” the IndividUpdate Page displays.

21.  Drag another Set Active Control icon onto the NO side of the Decision icon’s workflow.
27_drag_2nd_active_icon.png

22.  Right-click this icon and select Edit Workflow.

23.  This time, for the “Name of the control to set visible attribute on,” select CompanyUpdate.

24.  Click OK to save the rule.
The Edit Rule window closes and the workflow creation is complete.

25.  From the Workflow Designer menu bar, select the Save icon.
28_select_save00007.png
The Workflow Name window appears.
29_wf_name00008.png

26.  Enter a name for your workflow.
For example, UpdateButton.

Note.pngYou can not include spaces in your Workflow Name.

27.  Click OK.

28.  Close the Workflow Designer.
The new workflow displays in the Available Workflows window.

29.  Select your new workflow (e.g., UpdateButton) and click OK.
30_select_rule.png
The Workflow Name appears in the OnClick property of the Update Now button.
31_rule_in_property.png

30.  Save the form.

31.  You can now test your workflow by returning to your application, opening the form and searching for either an Individual or a Company and clicking Update Now to ensure the correct page displays based on the customer’s Record Type.