NetTalk Central

Author Topic: NTWS On Delete want to write out deleted record detaisl to another table  (Read 4156 times)

Johan van Zyl

  • Full Member
  • ***
  • Posts: 180
  • jvz
    • View Profile
    • Email
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.
« Last Edit: April 30, 2018, 12:28:39 PM by Johan van Zyl »
Johan van Zyl
Clarion 6.3 9058/C8 Gold/SQL/NetTalk WebServer

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
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