Hi all,
I have a peculiar situation. I have a script set to run at Table Post-Write on BM_BillHeader to return the new values. But no matter what I can only get the old value. This is in VBscript/SQL Server 2012 environment. The process/script logic is as follows.
- User changes bill's detail
- User accepts the change and triggers Table Post-Write event
- Script passes BillNo as parameter to a stored procedure (simplified below)
- INSERT INTO #table
- SELECT ComponentItemCode FROM BM_BillDetail WHERE BillNo = @BillNo
- The #table gets the new values
The expected values are the new values/new component and new quantity (not shown above) because it's POST write, but #table always gets the pre-change values. What perplexes me is that if I ran this logic at PRE-Write event, the script produces the same result. In addition, I have a couple scripts with the very same logic at Post-Write event on SO_SalesOrderHeader, which work as expected.
What am I missing? And How can I make the script return the new values?
Ken