«

»

Aug 06 2016

Table Triggers in JDE..Tricky

VN:F [1.9.22_1171]
Rating: 5.0/5 (2 votes cast)

JDE table triggers used to audit tables. It will be easy to track old values and new values as well.
We have Before INSERT/After Insert, Before Update/After Update,Before Delete/After Delete. By using TK values we can track table column details.

By Using TK values always will get only latest values from table.

How to track old values from table while updating? Whenever update happens on table thru TK values we get only updated values. Don’t know why? Here is a trick to get old values while updating.
Create NER or used standard Business functions to retrieve values from table. Get values which you want audit, compare them with TK values. If changed insert into temp table.

Imp Note:Whenever we write Table trigger we have to build.While building make sure that UTB is not open on FAT client.

Below is sample code. written on supplier Master(F0401).

=======================================================================
TABLE: Supplier Master
=======================================================================
EVENT: Before Record is Updated
———————————————————————–

0001 Get Audit Information
VA evt_TimeLastUpdated_UPMT BF szNameObject
TK Address Number -> BF mnAddressNumber
VA evt_szAddressType_AT1 <- BF szAddressType1
VA evt_PaymentTerms_TRAP <- BF szPaymentTermsAP
VA evt_cHoldPaymentCode_HDPY BF szObjectName
VA evt_UniqueKeyID_UKID BF mnUniqueKeyID
0007 VA evt_Description_DL01 = “Payment Term”
0008 F5504002.Insert
VA evt_UniqueKeyID_UKID -> TK Unique Key ID (Internal)
TK Address Number -> TK Address Number
VA evt_szAddressType_AT1 -> TK Search Type
VA evt_TransactionAction_TNAC -> TK Transaction Action
VA evt_szNameObject_OBNM -> TK Object Name
VA evt_Description_DL01 -> TK Description
VA evt_PaymentTerms_TRAP -> TK Address Line 1
TK Payment Terms – A/P -> TK Address Line 2
TK Program ID -> TK Program ID
VA evt_TimeLastUpdated_UPMT -> TK Time – Last Updated
SL DateToday -> TK Date – Updated
SL UserID -> TK User ID
0009 End If
0010 If TK Hold Payment Code is not equal to VA evt_cHoldPaymentCode_HDPY
0011 VA evt_Description_DL01 = “Hold Payment”
0012 Get Next Unique Key ID
“F5504002” -> BF szObjectName
VA evt_UniqueKeyID_UKID BF mnUniqueKeyID
0013 Convert Character to String
VA evt_cHoldPaymentCode_HDPY -> BF cCharacterToConvert
VA evt_szAddressLine_ADD1 BF cCharacterToConvert
VA evt_szAddressLine2_ADD2 TK Unique Key ID (Internal)
TK Address Number -> TK Address Number
VA evt_szAddressType_AT1 -> TK Search Type
VA evt_TransactionAction_TNAC -> TK Transaction Action
VA evt_szNameObject_OBNM -> TK Object Name
VA evt_Description_DL01 -> TK Description
VA evt_szAddressLine_ADD1 -> TK Address Line 1
VA evt_szAddressLine2_ADD2 -> TK Address Line 2
TK Program ID -> TK Program ID
VA evt_TimeLastUpdated_UPMT -> TK Time – Last Updated
SL DateToday -> TK Date – Updated
SL UserID -> TK User ID
0016 End If

Published under the license.

VN:F [1.9.22_1171]
Rating: 5.0/5 (2 votes cast)
Table Triggers in JDE..Tricky, 5.0 out of 5 based on 2 ratings
(Visited 517 times, 4 visits today)

About the author

Viswanath Rao

Leave a Reply