Versions Compared

Key

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

Script modules are used to define commonly used library functions. Modules can be called from pre work, post work like server environment, or form and validation rule like client environment.

...

  1. Click "+" icon from "Script Modules"
  2. Specify the module name. Because the module name is used in a script environment, whitespace or other punctuation chars cannot be used for it.
  3. Modify the module content as a following script:

...

Module parameters must be serializable primitive types like string, date, number or object. Other complex types like xml node or functions cannot be used as a parameterparameters.

Exporting Module Functions

...

Calling Module Function

Module functions should be called in "ModuleName.FunctionName(arguments)" syntax. For the example above, you call that function is called as the following;:

Code Block
var result = MyModule.sum(1,2);

...

Modules are always executed as synchronous context in server environment, but because of the browser limitations, client side modules can be renamed as "functionAsync" and return a javascript promise object to support asynchronous context. For example, the same module as the one above, can be called as following example;:

Code Block
MyModule.sumAsync(1,2).then(function(result) {
    // result = 3
});

...