4 5 4 Final WEBEVENT Function

LANSA Web Functions

4.5.4 Final WEBEVENT Function

The add function can be re-written using the WEBEVENT style as shown below:

 

FUNCTION 

OPTIONS(*DIRECT *WEBEVENT)

 

DEFINE

FIELD(#RENTRY) TYPE(*CHAR) LENGTH(1)

 

GROUP_BY

NAME(#PANEL) FIELDS(#EMPNO #SURNAME #ADDRESS ... (RENTRY *HIDDEN))

 

IF

COND('#RENTRY *EQ Y')

 

INSERT 

FIELDS(#PANEL) TO_FILE(PSLMST) VAL_ERROR(T01)

 

CHANGE

FIELD(#PANEL) TO(*NULL)

 

MESSAGE

MSGID(DCU0011) MSGF(DC@M01) MSGDTA ('employee')

 

ENDIF

 

T01

CHANGE

FIELD(#RENTRY) TO(Y)

 

REQUEST

FIELDS(#PANEL) DESIGN(*DOWN) IDENTIFY(*DESC) EXIT_KEY(*NO) MENU_KEY(*NO) USER_KEYS((01 SUBMIT))

 

An entry must be added to the WEBEVENT Links table using the Web Function Editor to link this process/function (via the user key1) to itself. The function would present an HTML page of input fields, as well as a button. When the button is clicked, the function would call itself and pass the data to be inserted into the PSLMST file.