2 System
: Property Management and Finance System
4 Author
: Donald Christie
6 Description
: Generic include file to create replication entries in the
7 replication log table on modify
8 Goes on the Replication-Create trigger which
9 is fires immediately after the create command
(ie no data
)
10 I need this as the
NEW function does not work in the
11 replication-write trigger.
12 Usage
: Pass in the table name and action.
13 &rtable = <name of the table of this trigger>
20 /* check that replication is valid at this site...
*/
23 FIND FIRST ReplTrigger
WHERE ReplTrigger.TableToRepl
= "{&rtable}"
26 IF AVAILABLE ReplTrigger
27 AND INDEX (ReplTrigger.Activity
, "C") <> 0
30 /* because the
NEW function does not work create a
31 blank repl entry in the replication create trigger
32 if this is a new record...
*/
36 ASSIGN ReplLog.ReplID
= NEXT-VALUE (Replid
)
37 ReplLog.OfficeCode
= Office.OfficeCode
38 ReplLog.TableToRepl
= '
{&rtable}'
39 ReplLog.TransactID
= DBTASKID (LDBNAME (BUFFER {&rtable}))
40 ReplLog.ReplDate
= TODAY
41 ReplLog.ReplTime
= TIME
42 ReplLog.TableRowID
= RECID ({&rtable})
43 ReplLog.ReplEvent
= "C".
46 END.
/* if available...
*/