How to Configure Dynamic Validation per Table in iDempiere

Dynamic Validation per Table lets iDempiere administrators attach a custom SQL filter to any table, scoped by Tenant, Organization, Role, or User. In retail operations, it restricts which sales orders, invoices, or warehouse records a store user or role can view or select. This directly controls transaction entry, reporting scope, and prevents cross-store or cross-warehouse data leakage during daily operations.

Process Flow

TenthPlanet iDempiere DynamicValidationPerTable

Business Rules

  • Active records are enforced immediately for the assigned Role or User.
  • A record with no Role or User applies the SQL Filter to the entire Organization.
  • The SQL Filter must reference the same table selected in the Table field.
  • Multiple Dynamic Validation rules can apply to the same table for different roles.
  • Inactive rules are ignored and do not restrict any records.
  • Filters use column names exactly as defined in the Application Dictionary.

Prerequisites

  • Table (Application Dictionary Table) already defined in iDempiere.
  • Role configured under System Admin > Role.
  • User/Contact created and linked to the Role, if scoping by user.
  • Organization structure configured for the tenant.

Navigation

Menu → General Rules → Security → Dynamic Validation per Table

Configuration Steps

Step 1: Open the Window and Create a New Record

Open the Dynamic Validation per Table window from the General Rules menu and click New to start a fresh rule.

TenthPlanet iDempiere GeneralRules DynamicValidation

Step 2: Select the Table, Role, and User Scope

Select the Table this rule applies to, such as C_Order, so the filter only affects that table’s records.

Field Reference Table

FieldSample ValueDescription
TenantPOTSClient the rule belongs to.
Organization*Organization scope; * applies across all organizations.
TableC_OrderTable whose records are filtered by the SQL Filter.
RolePOTS AdminRole the restriction is enforced for.
User/ContactSanthoshSpecific user the restriction is enforced for.
ActiveCheckedEnables or disables enforcement of the rule.
Description(optional)Internal note describing the rule’s purpose.
SQL FilterC_Order.M_Warehouse_ID=1000005WHERE-clause condition applied to the table.

Step 3: Write the SQL Filter Expression

Enter the SQL Filter using the table alias and column name, for example C_Order.M_Warehouse_ID=1000005.

Step 4: Set Active Status and Save

Check Active and save the record so iDempiere applies the filter to future queries immediately.

Step 5: Validate by Logging in as the Assigned Role or User

Log in as the assigned Role or User and open the target window to confirm only permitted records appear.

Common Issues and Resolutions

IssueCauseResolution
Rule not restricting any dataActive checkbox left uncheckedCheck Active and save the record again.
Error saving the SQL FilterColumn name misspelled or missing table aliasVerify the column exists and matches the table alias exactly.
Rule blocks all records unexpectedlySQL Filter condition evaluates false for every rowTest the SQL Filter directly against the database first.
Filter not applied for one userNo matching Role/User record exists for that personAdd a Dynamic Validation record for that specific Role or User.
Conflicting results across rulesMultiple active rules exist for the same table and roleReview all active rules for that table/role combination.
System Administrator still sees all recordsFilter does not apply to System Administrator roleThis is expected behavior; test with a limited retail role instead.
Slow performance on the filtered tableComplex SQL Filter subquery runs on every fetchSimplify the filter or add a supporting database index.

Next Steps

  • Configure Role and User/Contact setup if not already completed.
  • Review Window Access and Field Access for the same role.
  • Test the restriction end-to-end using a non-admin login.