View functions

EXTENDEDSCRIPT / EXTENDEDSCRIPT

Since Process17.0.0

Description

This function allows you to place JavaScript code on view cells in the following contexts:

  • Dynamic table;
  • Process documents view;
  • Data universe data view.

Syntax

1
@EXTENDEDSCRIPT("script")

La syntaxe de la fonction contient les arguments suivants :

The function contains the following arguments :

Parameter Description Mandatory Comment
script Script to execute. Yes Some variables are available depending on the context of use (see table below).

Available variables

Variable Description Comment
iContext Context of the logged-in user
iUser Logged-in user
iWorkflowModule Workflow module
iDirectoryModule Directory module
iPortalModule Portal module
iProjectModule Studio project module
iLinkedResource Dynamic table line Only available in the context of a dynamic table
iStorageResource Line of data universe view Only available in the context of a data universe view
iWorkflowInstance Line of process documents view Only available in the context of a process document view

return value

The function EXTENDEDSCRIPT returns a value dependent on the executed script code.

Examples

Example 1 : concatenation of the values of several cells in a virtual column

This example shows how to use the iLinkedResource variable to manipulate the cell values of a dynamic table row.

1
@EXTENDEDSCRIPT("iLinkedResource.getValue('FIELD1') + " " + iLinkedResource.getValue('FIELD2');")

Example 2 : execution of a Java class depending on the value of a field in the parent document

This example shows how to use the iLinkedResource variable to reach data in the parent document.

1
2
3
@EXTENDEDSCRIPT("var fieldValue = iLinkedResource.getParentInstance().getValue('FIELD_NAME'); if ( fieldValue != null )
return Packages.com.product.client.utils.ClassUtils.getFloatValue(fieldValue,...); else return new java.lang.Float("
0");")