Jump to content

On Execute: Difference between revisions

From Resco's Wiki
Marek Rodak (talk | contribs)
Marek Rodak (talk | contribs)
No edit summary
Line 31: Line 31:


[[File:OnExecute custom copy.PNG|600px]]
[[File:OnExecute custom copy.PNG|600px]]
== Questionnaires ==
If you are using custom commands in questionnaires, On Execute rules can be accessed in two ways:
* Traditional way using the '''On Execute''' button in the toolbar
* Using the '''Edit rules''' link directly in button configuration
[[File:Custom commands in questionnaires.png|600px]]
In terms of capabilities, these two options are equivalent. However, there is a difference:
* The '''On Execute''' button requires specifying which button was clicked (<code>If Command.name equals XY</code>).
* The '''Edit rules''' link is exclusive to the particular button, i.e., the first condition can be omitted.
=== Expand / collapse all instances of a repeatable group ===
In this example, we use the Button static component to expand or collapse all instances of a repeatable group - depending on whether the first instance of the group is expanded or collapsed. It showcases how to access data of a particular instance of repeatable group and how to modify all instances in bulk.
[[File:Expand or collapse all instances.png|600px]]

Revision as of 11:28, 26 January 2023

App users can execute commands from their app, for example, run a mobile report or delete several records at once. Predefined commands usually function out of the box. However, you can use rules to define their availability and tweak their function. On Execute lets you define actions that the command performs. This rule is triggered when the command button is pressed. For example, It can be filling in some data, hiding fields, etc. On Can Execute rule then modifies in which situations users can see and use the command.

On Execute is available for the following user interface components:

In Woodford, you can edit the commands available for a form. In Questionnaire Designer, you can edit the commands available when filling out a questionnaire.

Commands

List of available form and questionnaire commands can be found here.

Forms

Example: Field clearing command

We creat a custom command custom_del_street. When clicked, Entity.addres1_line1 field is cleared.

If Condition Command.Name Equals custom_del_street
Then Step Entity.addres1_line1 Clear

Example: Copy the record (Opportunity)

We create a custom command custom_copy. When clicked, new instance of the record is created and data are copied.