EverGreen: Table Trigger issue

Zoltan_Gyimesi

Zoltan_Gyimesi

Legendary Poster
Hi JDEList,

Platform: XE SP23 - SQL Database

Requirement:
In some conditions based on new TK values (and changes), I have to set a TK Field value (of course F0911 :)

I tried it in the "Before Record is Updated" TER.

I verywell know, that not all TK is populated in TER, so I Fetched some related value into variabless in this TER - to be on the safe side.

Of course, my "idea" did not work.

After I simplified my code and made my tests from the bottom to top (as I can not debug TER), I noticed:

#1.) Tk structure is not popoulated in this TER - as primary key fields also
#2.) Assigning a value to a TK field in this TER does not update this field in the table.

Please, do not advise to use database trigger, this is not a chance now.

Q1.) Is it a very well know issue and do I give this way up? (I searcehed JDEList, but haven't found a final answer).
Q2.) Any suggestion to solve this issue in TER on our XE SP23? Maybe to place the logic onto another Table Trigger?

Thanks in advance all of your input.

Regards,

Zoltán
 
Populating the TKs don't show after the update? That doesn't sound right. What's in the log's SQL?

Also, the whole key isn't always populated, but at a minimum the fields in the chosen logical will be (those that are passed, anyway).
 
Jeremy,

I've never even thought about debugging a TER.

How would you do it?
Are TERs available to the debugger?
Would you embed a bunch of "M&D Debugs"?

Please and Thanks
 
You can debug them just like NER's. When you create JDE trigger code and build the triggers, a c source file is created with the same name as the table object. The function name depends on the event in which the code is put.

In earlier releases (where you must specify the dll for debugging), you need to make note of the dll into which the code is compiled. It will be one of the JDBTRGx.dll files.
 
Hi Darren, Frosty, Jeremy,

First of all - excuse me this late reply / update.

Later I also tried After Record is Updated TER - with the same result, as key fields are not populated - neither.

At this point I gave up and I did not produced / examined debug log and did not debuged TER in C debugger, BECAUSE knowing, what is behind the scenes won't give me the solution - it is a dead-end, so I was looking for other solution and finally did it.

More details about my scenario:

When R09801 General Ledger Post Report run and set POST to 'P' and Batch Type (ICUT) is 'G' and Ledger Type is "AA" and DCT value has a 'V' in Special Handling Code in UDC: 00/DT and F0911.VINV is blank, then I have to generate a "right adjusted next order number by CO" to F0911.VINV, to store an "order history" information there.

As I do very well know, not all TK values are populated in TER - but I supposed, that primarey key fields are always populated (I missed) - so based on primary key I (tried) to fetch the related fields (ICUT, VINV, LT, etc.) into variables in TER, making possible to code the required logic.
...as you already know - without success

I suppose, the reason is, that R09801 updates the POST value on the Batch via a C BSFN (as I saw in the code) and I suppose, this BSFN constructs SQL update not on Primary key but maybe on ICUT / ICU, so it can be the reason, why are not populated the primary key fields.

My work around was to modify R09801 UBE, placing the required logic there.

At last, but not least - THANKS all of your advises / suggestions.

Regards,

Zoltán
 
Sorry for a late reply, but you may check the JDBJ.ini settings. I had a similar issue earlier; though for Before Delete Event. This might help your case.
Check this link - www.deepeshmd.com
 
Back
Top