Difference between revisions of "Script ModelValidator"

From ADempiere
Jump to: navigation, search
This Wiki is read-only for reference purposes to avoid broken links.
 
m (See Also)
Line 60: Line 60:
 
*[[Script ModelValidatorLogin]]
 
*[[Script ModelValidatorLogin]]
 
*[[Script Callout]]
 
*[[Script Callout]]
 +
*[[ModelValidator]]
  
 
[[Category:Features]]
 
[[Category:Features]]
 
[[Category:Developer documentation]]
 
[[Category:Developer documentation]]
 
[[Category:Development]]
 
[[Category:Development]]

Revision as of 19:00, 14 April 2010

Status

Creating the Rule

The model validator script can be called for changes on tables or status of documents.

The list of supported events are:

  • For Tables
    • TBN - Table Before New
    • TBC - Table Before Change
    • TBD - Table Before Delete
    • TAN - Table After New
    • TAC - Table After Change
    • TAD - Table After Delete
  • For Documents
    • DBPR - Document Before Prepare
    • DBCO - Document Before Complete
    • DBCL - Document Before Close
    • DBVO - Document Before Void
    • DBAC - Document Before Reactivate
    • DBRA - Document Before Reverse Accrual
    • DBRC - Document Before Reverse Correct
    • DBPO - Document Before Post
    • DAPR - Document After Prepare
    • DACO - Document After Complete
    • DACL - Document After Close
    • DAVO - Document After Void
    • DAAC - Document After Reactivate
    • DARA - Document After Reverse Accrual
    • DARC - Document After Reverse Correct
    • DAPO - Document After Post

Within the script you can use:

  • Window context variables start with a W_ prefix
  • Login context variables start with G_ prefix
  • Parameters for callout start with A_ prefix
    • A_Ctx
    • A_PO
    • A_Type
    • A_Event

01 ScriptModelValidator.png

Configure Script Validator from Table/Column

02 ScriptModelValidator.png

Sample Code provided for copy/paste testing

On the Rule Search Key:

beanshell:AD_Rule_after_save

On the Rule Script:

A_PO.setDescription(A_PO.getName());
result = "";

See Also