SOLUTION ID: 201016296
E1: TDA: How TK values are populated in an EnterpriseOne Table Trigger
ISSUE:
I have created a table trigger on an EnterpriseOne table. The TK values are either not populated or already contain the After values in the table events, which is not consistent. Why?

SOLUTION:
Per Development, an EnterpriseOne Table Trigger does not function like a Database Trigger. It cannot be used to capture Before and After values because the JDB runtime code has only one buffer and this buffer is used for both Before and After triggers.
On the Windows client, the JDB runtime code does not pre-fetch all columns of the table prior to executing the Delete and Update Table Events.
On the Web client, the JDB runtime code will pre-fetch all columns of the table prior to executing the Delete and Update Table Events, provided that the setting triggerAutoFetch is set correctly in the INI configuration file.
Following edits are required
Xe/ERP8.0 with SP23 & higher
jas.ini
[OWWEB]
triggerAutoFetch=true
8.9 & above
jdbj.ini
[JDBj-RUNTIME PROPERTIES]
triggerAutoFetch=all
If the triggerAutoFetch setting is not on, then the table trigger works like a windows client.
The following explains the state of the TK values for each Table Event Rule (TER) :-
1. Before Record is Deleted / After Record is Deleted
Windows client - All TK values are not populated unless a JDB_Fetch was issued on the table prior to the Delete.
Web client with triggerAutoFetch on - All TK values are populated
2. Before Record is Fetched
This event is not triggered by the JDB runtime code. SAR 8133684 requests for this event to be removed in Table Trigger Design Aid
3. After Record is Fetched
TK values are populated for the table columns included in the JDB_Fetch
4. Before Record is Inserted / After Record is Inserted
TK values are populated for the table columns included in the JDB_Insert
5. Before Record is Updated / After Record is Updated
Windows client - TK values are populated with the After values ONLY for the table columns included in the JDB_Update. If TK values of specific table columns are not populated, ensure that these table columns have been included in the list of columns of the JDB_Update.
Web client with triggerAutoFetch - All TK values are populated; TK values for the table columns included in the JDB_Update are populated with the After values.