Difference between revisions of "Script Callout"

From ADempiere
Jump to: navigation, search
This Wiki is read-only for reference purposes to avoid broken links.
(Code provided for copy/paste testing)
Line 45: Line 45:
 
  }
 
  }
 
  result = "";
 
  result = "";
 +
 +
=See Also=
 +
*[[Script Process]]
 +
*[[Script ModelValidatorLogin]]

Revision as of 17:11, 25 January 2008

Status: working in version > 3.3.1b

Contributed by:
Quality Systems & Solutions - QSS Ltda.
Carlos Ruiz

Improvements by:
E-Evolution
Víctor Pérez
make it work with any java scripting language https://scripting.dev.java.net


Create the Rule

Within the script you can use:

  • Window context variables start with a single underscore _
  • Login context variables start with two underscores __
  • Parameters for callout start with three underscores ___
    • ___WindowNo
    • ___Tab
    • ___Field
    • ___Value
    • ___OldValue

In standard Adempiere were uploaded jars to work with groovy, jython and beanshell

01 BeanShell.png

Configure the callout

02 BeanShellCallout.png


Code provided for copy/paste testing

On the Table and Column, callout reference:

@script:beanshell:BP_fillDescriptionFromName

On the Rule Search Key:

beanshell:BP_fillDescriptionFromName

On the Rule Script:

if (___Tab.getValue("Name") != null) {
    ___Tab.setValue("Description", ___Tab.getValue("Name"));
}
result = "";

See Also