2 System
: Property Management and Finance System
4 Author
: Donald Christie
6 Description
: Generic include file to create replication entries in the replication log table on modify
7 Goes on the replication delete trigger.
8 Usage
: Pass in the table name and action.
9 &rtable = <name of the table of this trigger>
18 /* check that replication is valid at this site...
*/
20 FIND FIRST ReplTrigger
WHERE ReplTrigger.TableToRepl
= "{&rtable}"
23 IF AVAILABLE ReplTrigger
24 AND INDEX (ReplTrigger.Activity
, "D") <> 0
27 /* need this as the raw-transfer statement messes up if a
28 table variable name is the same as the table name...
29 e.g. AreaType.AreaType
!
31 DEFINE TEMP-TABLE del
{&rtable} NO-UNDO LIKE {&rtable}.
34 BUFFER-COPY {&rtable} TO del{&rtable}.
38 ASSIGN ReplLog.ReplID
= NEXT-VALUE (Replid
)
39 ReplLog.OfficeCode
= Office.OfficeCode
40 ReplLog.TableToRepl
= '
{&rtable}'
41 ReplLog.TransactID
= DBTASKID (LDBNAME (BUFFER {&rtable}))
42 ReplLog.ReplDate
= TODAY
43 ReplLog.ReplTime
= TIME
44 ReplLog.ReplEvent
= "D"
45 ReplLog.TableRowid
= RECID ({&rtable})
48 RAW-TRANSFER del
{&rtable} TO ReplLog.ReplBI.
49 END.
/* if available...
*/