Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

What is Form Scripting?

In some cases, additional logic must be added to a form. For example

  • update the value of a form widget based on the changes on in another widget

  • do perform special calculation for some widget values

  • do perform more complex validation of widget values (especially if widgets must be “cross” validated)

  • and more…

...

Info

Form Scripting requires JavaScript knowledge!
By using it, you could leave the field of “easy” low coding and could potentially create very complex algorithms which could be very hard to explain to other team members. Therefore, make sure in the first step sure, that Form Scripting is the only way to solve your task. If so, then make sure to write as less little and clean code as possible to implement your task using Form Scripting.

See here for a full JavaScript reference: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference

...

In case you have to implement more complex logic which is more than a single line, then consider to put your form script into a property in the property store and link to it like this:

...

For each event you have to define a function with the name of the event and finally then return it.

Inside the method you can use the fieldIdvariable in order to check whether this event was caused be the widget you are interested in.

Info

Note
You cannot mix an external script with inline definitions. You ; you have to decide for choose one of them.

Calling a Command from inside a Form Script

...