Block column usage type in Jitterbit App Builder
Block is a usage type that prevents a row from being edited, deleted, or both. A data object can only use one Block column, and the value it returns determines the restriction:
| Cell value | Description |
|---|---|
1 |
Prevents editing of that row. |
2 |
Prevents deleting of that row. |
3 |
Prevents both editing and deleting of that row. |
| Any other value | Does not prevent anything. |
Note
The block usage type can also be set through a dedicated mvSQL database function. See Block() function.
Where to apply Block columns
You can add a Block column at two different levels, and where you add it changes how far the restriction reaches:
- Data layer: Add a column directly to a table, with its Column Usage Type set to Block. Because every business object built on that table inherits the column, the restriction applies globally: everywhere the table's data is used throughout the app.
- Business logic layer: Add a column with an expression to a business object, with its Column Usage Type set to Block. Because the expression only exists on that specific business object, the restriction only applies where that object is used, and doesn't affect other rules built on the same underlying table.
Preferably, alias the column as Block so its purpose is clear to other developers.
Override an inherited Block value
If a business object is built from a table that already has a Block column, you can add an expression on the business object that targets the inherited column to further customize whether a row is blocked. For example, consider the following expression:
iif(who('username')='admin',0,customers.block)
This overrides the table's Block value for administrators, letting them bypass the restriction while everyone else keeps the table-level behavior.
Example
In the following screenshot, the Edit pencil icon and the Delete trash can icon are both hidden for certain records. This is being done through the Block column usage type.
