NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: Johan van Zyl on April 30, 2018, 11:24:11 AM

Title: NTWS On Delete want to write out deleted record detaisl to another table
Post by: Johan van Zyl on April 30, 2018, 11:24:11 AM
Hi

I have some Audit code that works well to write all inserted or updated info to the audit tables.
In case of Delete and I would also like to write the deleted record's details to a deletetable/archive.

In the case of Insert and Update the audit code goes into PostInsert and PostUpdate and it works as intended.
It does not work in PostDelete as the record has been deleted. Which would be the correct embed points to put the code for Audit and delete table?

NOTE:In all the Pre embeds I have "p_web.FileToSessionQueue(tpeople,false,'HIS')"

UPDATE: Ok In PostDelete the code writes to the Audit Files - it gets old values from "p_web.FileToSessionQueue(tpeople,false,'HIS')" and then writes a record for each field. For archive I would want the whole record to be written out in one go.
Title: Re: NTWS On Delete want to write out deleted record detaisl to another table
Post by: Bruce on May 02, 2018, 10:49:21 PM
as you say, the old record is likely in the SessionQueue. so
p_web.SessionQueueToFile
would prime the record with the old values. (just don't write it after that.)

cheers
Bruce