Add %age area column to vacancies section.
[capital-apms-progress.git] / rplctn / dreptrig.i
blob4cdcc49fdbf7411fd048aa8957947aa99d289713
1 /*
2 System: Property Management and Finance System
3 Program: dreptrig.i
4 Author: Donald Christie
5 Date: 26/08/97
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>
11 Modification Notes
16 {inc\ofc-this.i}
18 /* check that replication is valid at this site...*/
20 FIND FIRST ReplTrigger WHERE ReplTrigger.TableToRepl = "{&rtable}"
21 NO-LOCK NO-ERROR.
23 IF AVAILABLE ReplTrigger
24 AND INDEX (ReplTrigger.Activity, "D") <> 0
25 THEN DO:
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}.
33 CREATE del{&rtable}.
34 BUFFER-COPY {&rtable} TO del{&rtable}.
36 CREATE ReplLog.
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})
46 ReplLog.ReplAI = ?.
48 RAW-TRANSFER del{&rtable} TO ReplLog.ReplBI.
49 END. /* if available...*/