Getting Started with TRANSACT (32247-90007)
172 Chapter9
Creating Custom Applications
User Exits
Figure 9-26. Providing User Exits (Continued)
The user exit is established in a way similar to that used to achieve form independence. A
cross reference file is set up to contain the name of the subprogram to be called based upon
the name of the form that the program is currently processing.
The content of this cross-reference file is:
Figure 9-27. User Exit cross Reference Table
48 call (userexit-prog),data=userexit-marker;
49 if (error) = (yes)
50 then end;
51 if (lastkey) = 0
52 then perform modify
53 else
54 do
55 set(match) list (menuname);
56 let (fkey) = (lastkey);
57 set(match) list (fkey);
58 get(serial) formxref,list=(menuname,fkey,screen);
59 reset(option) match;
60 perform modify;
61 doend;
62 end;
63
64 modify:
65
66 set(key) list (cust-no);
67 get customer,list=(@);
68 put(form) (screen),window=("update? - f1=yes, f2=no");
69 get(form) (screen),f1(autoread)=modify-f1
70 ,f2=modify-f2;
71
72 modify-f1:
73
74 update customer,list=(@);
75
76 modify-f2:
77
78 end;
MENUNAME: USEREXIT-PROG:
-------------------------------
CUSTUPDATEMM CU1