Add a new UserGroupRight to control access to open/close months.
[capital-apms-progress.git] / trigger / a-ofcths.p
blobacc3168e791ed31cfc3ddc2d052620a63d85047a
1 TRIGGER PROCEDURE FOR ASSIGN OF Office.ThisOffice OLD VALUE old-value.
3 IF ThisOffice <> old-value THEN DO:
4 IF ThisOffice = yes THEN DO:
5 ON ASSIGN OF Office.ThisOffice OVERRIDE DO:
6 /* nothing - we don't want to call ourselves recusively! */
7 END.
9 DEFINE BUFFER temp-office FOR Office.
10 FOR EACH temp-office WHERE temp-office.ThisOffice = yes
11 AND RECID(Office) <> RECID(temp-office):
12 temp-office.ThisOffice = no.
13 END.
15 /* Revert back to this trigger procedure */
16 ON ASSIGN OF Office.ThisOffice REVERT.
17 END.
18 ELSE DO:
19 MESSAGE "You should assign a new office to be 'This'" SKIP
20 "and all other offices will be cleared"
21 VIEW-AS ALERT-BOX ERROR.
22 RETURN ERROR.
23 END.
24 END.