selectAction()
Last updated 17/01/2025
The
To demonstrate
Create Process A
1. Select Tasks in the menu.2. Select Processes in the sub-menu.
3. Click the Add Item button.
4. Type Process A in the Title field.
5. Click the Screen Fields tab.
6. Click the Add Screen Fields button.
7. Type This is Process A in the Caption field.
8. Click the lookup icon in the Display Type field and select _Label.
9. Click the Save button in the form app bar.
10. Click the Save button in the form app bar above the list.
Create Process B
1. Click the Add Item button.2. Type Process B in the Title field.
3. Click the Screen Fields tab.
4. Click the Add Screen Fields button.
5. Type This is Process B in the Caption field.
6. Click the lookup icon in the Display Type field and select _Label.
7. Click the Save button in the form app bar.
8. Click the Save button in the form app bar above the list.
Create a Menu Item for Process A
A menu item needs to be created that references Process A.
1. Select Visual in the Menu.2. Select Menus in the sub-menu.
3. Click the Add Item button.
4. Type Process A in the Caption field.
5. Click the lookup icon in the Action field and select ProcessA (Process).
6. Click the Save button in the form app bar.
Add the ToProcessB Function
The
2. Select Functions in the sub-menu.
3. Click the Add Item button.
4. Type ToProcessB in the Function ID field.
5. Click in the Code field to open the Code Editor.
6. Copy and paste the code block below into the editor.
function ToProcessB(five, context, result) {
five.selectAction('ProcessB');
return five.success(result);
}
8. Click the Save button in the form app bar
Edit Process A
Process A needs to be edited to add a button, this button will have an On Click event that will reference the ToProcessB function. When the button is clicked, Process B will be selected and the user will be navigated to Process B without leaving the Process A menu item.
1. Select Tasks in the menu.2. Select Processes in the sub-menu.
3. Select the Process A record in the list.
4. Click the Screen Fields tab.
5. Click the Add Screen Fields button.
6. Type To Process B in the Caption field.
7. Click the lookup icon in the Display Type field and select _Button.
8. Click the Events tab.
9. Click the lookup icon in the On Click field and select ToProcessB.
10. Click the Save button in the form app bar.
11. Click the Save button in the form app bar above the list.
How This Will Work in an Application
Once you deploy/run your application, you will be positioned on the Process A menu item which references Process A. Process A has the To Process B button that has the ToProcessB function attached to the On Click event, so that when the button is clicked the event will execute the function to select the Process B process.
1. Click the To Process B button.