Default (Rule) in Jitterbit App Builder
Default rules are used to automatically populate fields on a panel when a new record is created or an existing record is edited. For example, a developer might create a rule to default a Date field to the current date or to populate a Status field with a specific initial value.
In App Builder, these rules primarily utilize implicit binding. This means the system automatically substitutes the target table in the rule's logic with the context of the "current" row being interacted with in the UI.
Default binding
Default rules rely on data mapping to function correctly. While the binding is often implicit, the rule's SQL must be structured properly to avoid errors:
-
Implicit Substitution: When the rule executes, the first instance of the target table in the rule is replaced by the active row's data.
-
From Clause Requirement: To ensure implicit binding works as desired, the
FROMclause in your SQL rule should reference the storage table for the data object. -
Duplicate Handling: If a default rule returns an error regarding "too many rows", developers should verify the
FROMclause or consider using aDISTINCTflag to ensure a single result is returned per field.
How to register default rules
The process for registering and defining the binding for defaults has changed in recent versions of App Builder. It is no longer handled in the same location as previous iterations.
-
Create the rule: Navigate to the Business Logic layer and select Business SQL to draft your defaulting logic.
-
Define the binding: Unlike standard action bindings, defaults are registered in a specific area of the App Builder IDE designated for rule purposes.
-
Map to UI: Once the rule is registered with the Default purpose, it must be associated with the specific field on the panel via its page edit screen.
Implementation example
The following video provides a visual overview of creating default logic. Note that while the core SQL concepts remain valid, the specific UI location for registering these rules has been updated as described above.