Documentation Index
Fetch the complete documentation index at: https://mintlify.com/idempiere/idempiere/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Callouts are client-side event handlers that execute when field values change in iDempiere windows. They are used for:- Field validation and cross-field validation
- Setting default values in other fields
- Dynamic field updates based on user input
- Real-time calculations
org.adempiere.base and org.compiere.model
Source Files:
org.adempiere.base/src/org/adempiere/base/IColumnCallout.javaorg.adempiere.base/src/org/compiere/model/Callout.javaorg.adempiere.base/src/org/compiere/model/CalloutEngine.java
Interfaces
IColumnCallout Interface
The modern, simplified callout interface. Package:org.adempiere.base
start Method
Context containing session and environment variables
Window number (for multi-window environment)
Tab model containing the field and current record data
Field model that triggered the callout
The new value being set
The previous value before change
Empty string ("") for success, or error message to display and reject the change
When the callout is invoked, the Tab model already has the new value set.
Callout Interface (Legacy)
The traditional callout interface with additional conversion method. Package:org.compiere.model
start Method
Method name in format “ClassName.methodName”
convert Method
Conversion method name in format “User_Function”
Input value to convert
Converted value, or null if method not found
Implementation
Using IColumnCallout (Recommended)
Direct implementation of the interface:Using CalloutEngine (Traditional)
Extend CalloutEngine for more structure:Using @Callout Annotation
For iDempiere 7.1+, use annotations for cleaner code:GridTab Methods
Common methods for interacting with the tab:Get Values
Set Values
Field Access
GridField Methods
Get Field Information
Get/Set Values
Common Patterns
Preventing Recursive Calls
Validation with Error Messages
Cross-Field Updates
Database Lookups
Callout Registration
To register a callout in iDempiere:- Implement your callout class
- Register in Application Dictionary:
- Go to Table and Column window
- Find your table and column
- In column record, set Callout field to your class and method:
- For IColumnCallout:
com.example.callout.MyCallout - For traditional Callout:
com.example.callout.MyCallout.methodName
- For IColumnCallout:
- Deploy your callout class in a plugin/jar
- Restart client to load the callout
Best Practices
- Return Empty String: Always return
""for success, never null - Validate Input: Check for null and invalid values early
- Prevent Recursion: Use
isCalloutActive()when setting values that might trigger other callouts - Keep It Fast: Callouts run synchronously on UI thread - avoid heavy operations
- Use Context: Read window context with
Env.getContext(ctx, WindowNo, "VariableName") - Error Messages: Return user-friendly error messages; use
@Variable@for translation - Null Safety: Always check for null before casting or using values
- Cache Lookups: Cache frequently accessed data when possible
- Transaction: Don’t use transactions in callouts - they’re UI operations
- Testing: Test callouts thoroughly with various field combinations
See Also
- Model API - Working with persistent objects
- Process API - Server processes
- Factory Pattern - Callout factories