Join the Power Platform Masterclass #2 starting April 23

Business logic: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
Line 27: Line 27:
* [[Map]]
* [[Map]]


See [[Rules editor]] for more information about rules.
We are continuously adding rules support to UI components. See [[Rules editor]] for more information about rules.


== Scripting language ==
=== Scripting language ===
[[File:Sample rule.png|thumb|right|300px|Sample rule]]  
[[File:Sample rule.png|thumb|right|300px|Sample rule]]  
Rules are formed in a simple scripting language. Essentially, you combine '''conditions''' and '''steps'''.
Rules are formed in a simple scripting language. Essentially, you combine '''conditions''' and '''steps'''.
Line 55: Line 55:
You don't write scripts, you build them using buttons and selecting values from a drop-down menu. Use the [[dot notation]] to work with entity fields or object properties.
You don't write scripts, you build them using buttons and selecting values from a drop-down menu. Use the [[dot notation]] to work with entity fields or object properties.


== Objects in rules ==
=== Objects in rules ===


Rules allow you to evaluate and modify parameters of various objects:
Rules allow you to evaluate and modify parameters of various objects:
Line 66: Line 66:
* Specialties
* Specialties


== Form rules ==
=== Form rules ===


Form rules describe sequences of steps that are executed on form-related events. They allow you to for example to customize edit form user interface (hide or disable fields, assign values, etc.).  
Form rules describe sequences of steps that are executed on form-related events. They allow you to for example to customize edit form user interface (hide or disable fields, assign values, etc.). Here are some of the events available for forms:


; On Load: These rules are checked when you open a form. You can use these rules for example to apply custom format to certain records.
; On Load: These rules are checked when you open a form. You can use these rules for example to apply custom format to certain records.
; On Change: These rules are checked when you open a form or modify any field. Example: simple form validation.
; On Change: These rules are checked when you open a form or modify any field. Example: simple form validation.
; On Save: These rules are checked when you save a record. For example, saving a record can automatically also update a field in a parent record.
; On Save: These rules are checked when you save a record. For example, saving a record can automatically also update a field in a parent record.
; On Can Execute: Define when a form command is available for the user.
; On Execute: Define the actions that the command performs.


Rules also control the behavior of commands: when should a command be displayed and what should it do.
=== View rules ===
* '''On Can Execute''' rule defines when the command will be available for the user.  
These are some of the events that trigger rule execution for views.
* '''On Execute''' rule defines the actions that the command performs.
; [[View#Row_scripts|Row Script]]: Define conditions when a specific row design should be used.
; On Save, On Change: These events are used in conjunction with [[View#Editable_field|editable lists]], where they play similar role as on the form.
; Button Click: Executed when a row button is clicked.
; Cell Click: Executed when an editable or clickable cell is clicked.
 
== JavaScript ==
 
[[Resco JavaScript Bridge]], or JSBridge.js, is a component provided by Resco that allows the scripts in the HTML frame to interact with Resco mobile apps. You can interact with the user interface, with data, and perform additional actions. Script files need to be included in the project using the [[Offline_HTML#Resco_JavaScript_Bridge|Offline HTML]] section of Woodford.


== View rules ==
Rules and JavaScript can even be combined, see [[Execute JavaScript from rules]] for more information.
; Row Script
; On Save, On Change: These events are used in conjunction with [[View#Editable_field|editable lists]], where they play similar role as on the form.
; Button Click
; Cell Click


== See also ==
== See also ==

Navigation menu