1 TRIGGER PROCEDURE FOR WRITE OF Contact.
3 /* seems to be a deadlock problem between this and the Person trigger
*/
5 /* trying again
- 7/12/98 */
7 IF NEW( Contact
) THEN DO:
8 DEF VAR system-contact
AS LOGI
NO-UNDO INITIAL No.
10 DEF BUFFER CtcType
FOR ContactType.
11 DEF BUFFER OtherContact
FOR Contact.
13 FIND ContactType
OF Contact
NO-LOCK NO-ERROR.
14 IF AVAILABLE(ContactType
) THEN system-contact
= ContactType.SystemCode.
16 IF system-contact
THEN DO:
17 FOR EACH OtherContact
WHERE OtherContact.PersonCode
= Contact.PersonCode
18 AND RECID(OtherContact
) <> RECID(Contact
) NO-LOCK,
19 FIRST CtcType
OF OtherContact
NO-LOCK:
20 IF NOT CtcType.SystemCode
THEN system-contact
= No.
24 FIND Person
OF Contact
EXCLUSIVE-LOCK NO-ERROR.
25 IF AVAILABLE(Person
) THEN ASSIGN
26 Person.SystemContact
= system-contact
27 Person.LastModified
= TODAY.