Configure the Navigate To Another Form Action
Use the Navigate to another Form action when you want to redirect the user from one form to another, for example when a button on the form is clicked. This action is useful when you want to provide additional information such as showing a confirmation page, viewing and editing a list of values, or completing a survey.
This demonstration uses rule events, conditions, and actions to evaluate values on the parent form, then opens a child form and loads content based on those values.
For information on navigating to a URL see: Configure the navigate to URL action.
Example 1: On the Add Sales Employee Form, the desired region does not appear in the Region (Drop-Down List). Clicking the Edit Regions button opens the Add Region Form where you can add the region you need.
Example 2: On the Add Sales Employee Form, the region appears in the drop-down list but needs updating. Clicking the Edit Regions button opens the Add Region Form with the selected region loaded in the Edit Regions Item View. In both examples, a condition executes after clicking the Edit Regions button. The condition checks to see if a region is selected and if so, loads the region details in the Edit Regions Item View.
Try it yourself!
Use the navigation actions to open another form and perform actions such as go to a tab or execute a view method. In this demonstration, after you click a button on the Add Sales Employee Form (parent form), the Add Region Form (child form) opens where you can add or edit a region. Note that the Navigation actions are the same for forms and views.
Add Sales Employee Form > When Edit Regions is Clicked
The rule configuration begins with adding a new rule to the Add Sales Employee Form called When Edit Regions is Clicked. This rule contains a condition followed by an action for a true response and an action for a false response.
Point | Rule | Notes |
---|---|---|
A | Condition | When you click the Edit Regions button, a rule executes beginning with a condition. The condition checks if the Region Drop-Down List control has a value. |
B | Action | If the Region Drop-Down List control contains a value, a Navigate to another Form and execute a View method action executes and opens the Add Region Form. As part of the navigation action configuration, the Region Drop-Down List value is mapped to the Regions SmartObject. The mapped value is the ID of the region. |
C | Action | If the Region Drop-Down List control does not have a value, a Navigate to another Form action executes and opens the Add Region Form with no further configuration. |
Parent Form
Follow the steps below to configure the rule on the form. This example uses two forms called Add Sales Employee Form and Add Region Form. The Add Sales Employee Form contains a drop-down control called Region and a button control called Edit Regions. The Add Region Form contains three views called List Existing Regions View, Add Regions Item View, and Edit Regions Item View.
- Edit the Add Sales Employee Form and navigate to the Rules tab. Click Add Rule.
- With the Events tab active, click When a control on the Form raises an event to add it to the rule definition pane. Click the select control link and select the button control to execute the event. In this scenario it is Edit Regions.
The select event link automatically changes to the default action for buttons: Clicked.Rules consist of events, conditions and actions. A valid rule contains at least one action.
- Events define when the rule should run, such as when a button is clicked, or when the form loads. (Events are optional, you can define "event-less" rules that you can call from other rules.)
- Conditions define whether the rule should run. If the criteria are true, continue the rule, and if the criteria are not met, stop the rule. For example, a condition might evaluate a form to confirm that required fields have content. (Conditions are optional - not all rules will require conditions.)
- Actions define what the rule should do. For example, show a message, start a workflow, or enable a form field. Rules can contain multiple actions that are run in sequence or in parallel.
- Click the Conditions tab, then click a control on a View contains a value and select Region Drop-Down List.
- With the Actions tab active, click Navigate to Another Form and execute a View method. Select Add Region Form, Edit Region Item View, and Load. Click configure.
- On the Navigate to Add Region Form screen, keep the default Form State value, (Base State). For Open In, select New Window (or Tab).
Feature Purpose Use Form Settings Form State States allow you to use the same form for different workflow tasks. You create states as part of the task configuration in a workflow. - Each form has a base state. If a form's associated workflow has additional states, they show in the Form State drop-down list. If there are no additional states, the base state is used.
Select a state from the Form State drop-down list or click the toggle to drag a property from the Context Browser. Open In Use this setting to control where the destination (child) form opens. - Current Window - The destination (child) form opens in the current window. In most instances selecting this option is the same as selecting to open in the parent window. However, when using forms in an iframe in SharePoint for example, this option results in the form opening within the SmartForms frame.
- New Window (or Tab) - The destination (child) form opens in a new window or tab.
- Parent Window - The destination (child) form opens in the parent window/frame. In most instances choosing this option is the same as choosing to open in the current window. However, when using forms in an iframe in SharePoint, for example, this option provides the functionality to run the form outside the SmartForms frame. If you select Current Window, the destination (child) form opens within the SmartForms frame.
- You can change the drop-down list to a text box by clicking the toggle just right of the control. Switching to a text box allows you to manually enter open values or use variables from the Context Browser.
Select a method from the Open In drop-down list or click the toggle to drag a property from the Context Browser. - In the Context Browser, expand Add Sales Employee Item View > Controls. Drag the Region Drop-Down List control into the Mapping Destinations > ID input property. You map the ID of the region selected on the parent form to the Regions SmartObject to load the correct record on the child form. (As a short-cut, you can also click the Auto-Map button to create the mapping.)
- Click Finish to complete the configuration.
- Click the Conditions tab and click Else.
- Click the Actions tab and click Navigate to Another Form. This adds the action below the Else condition. Select the Add Region Form. There are no further configurations. (Remember, the false condition means there is no region selected, so you don't need to pass any input properties to the Regions SmartObject.)
- The completed rule for the parent form should look like the image below. Click OK to save and exit the rule. Click Finish to save and exit the form.
Next, you add a condition that checks if the Region Drop-Down List control has a value. If it does, you can assume the user wants to edit the record since they clicked the Edit Regions button. If the control does not contain a value, you can assume the user wants to add a new region.
The next step is to add actions based on the condition result (conditions are either true or false). If the condition is true, you want to retrieve the details for the selected region and load them into the Edit Regions Item View (on the Add Region Form). If the condition is false, you just want to open the Add Region Form.
Remember, this is the action executing in response to the true condition. This action navigates to a new form so you can edit the region details. You need to map the ID of the region selected to the Regions SmartObject so that the correct region details load for editing. You also configure the state and open in values.
Next, you configure mapping destinations. Here, you map the ID of the region selected in the Region Drop-Down List (on the parent form) to the Regions SmartObject. In this way, when the load method executes, you have a value to retrieve the correct region for editing.
Feature | Purpose | Use |
---|---|---|
Auto Map | When you click Auto Map, the system tries to find any matches between controls and SmartObject properties. If a match is found, the mapping is created for you. Auto-mapping does not work for destination parameters, so you must manually map these properties. | Click Auto-Map. When working with parameters, you must manually map controls. |
Clear All | Removes all destination mapping values. | Click Clear All. |
Context Browser | The Context Browser contains references, variables, functions, and SmartObject properties. At runtime, references and variables are replaced with live data. For example, the ID reference is replaced with the ID of the current record. | Drag properties from the Context Browser into text boxes in the Mapping Destinations section. |
Preview | The URL to the destination (child) form. | You can click the URL to test if it works. |
You have completed the configuration for the true response to the conditional statement. Next, you add another action that opens the child form without any configuration. This is the action for the false response to the condition, when the Region Drop-Down List control does not contain a value.
Testing the form
Test the rule configuration by running the Add Sales Employee Form.
- Click the Edit Regions button without selecting a region and notice how the Add Regions Form opens in a new window. You can now add a region in the Add Regions Item View.
- Select a region and then click the Edit Regions button. Notice the Add Regions Form opens and the details of the region you selected are shown in the Edit Regions Item View.
- The destination (child) form must exist before you configure the navigation rule on the parent form. The best practice is to create the SmartObjects, views, and forms first, then configure the rules.
- If using parameters to pass data, for example, as an input property for executing a view or SmartObject method, you must create the parameter before you configure the navigation rule properties.
- If you intend to navigate to a specific state on a form, you must create the workflow and task steps, including the state definition, before you configure the navigation rule properties. For more information on states see Form States.