This function returns a number indicating the error status of the specified panel field.
This function assists in error processing but you can only use it if the edit‑rule error procedure option of the panel parameter fill‑in was specified as A for application. For more information, see the Creating Panel Definitions Guide.
This function has the following format:
$PANEL‑FIELD‑ERROR(field‑name)
The field on the panel tested.
The following chart lists the values that can be returned and explains what they mean.
|
Number |
Description |
|---|---|
|
0 |
No error. |
|
1 |
A required field is missing. |
|
2 |
Non‑numeric data is detected in a numeric field. |
|
3 |
Field content is outside the range specified as the minimum and maximum values allowed for the field. |
|
4 |
An invalid check digit was specified. |
|
5 |
The field entry does not have the required number of decimal places. |
|
6 |
A field specified as must‑fill was not filled. |
|
99 |
Reserved for future use. If this code is returned, call CA Ideal Technical Support. |
Examples
LOOP
SET USER‑ERROR = FALSE : Defined in working data
TRANSMIT PANEL‑A REINPUT
SELECT WHEN $PANEL‑FIELD‑ERROR(FIELD‑1) = 3
SET MESSAGE‑FIELD = “FIELD‑1 IS OUTSIDE OF RANGE”
WHEN $PANEL‑FIELD‑ERROR(FIELD‑99) = 1
SET MESSAGE‑FIELD = “REQUIRED FIELD IS MISSING”
WHEN $PANEL‑FIELD‑ERROR(FIELD‑2) = 1 : Not received
SET FIELD‑2 = 'default‑value'
WHEN PNL‑FDL1 NOT = PNL‑FLD2 * 2
SET MESSAGE‑FIELD = “UNSUPPORTED FUNCTION”
SET USER‑ERROR = TRUE
ENDSELECT
WHILE $PANEL‑ERROR(PANEL‑A) OR USER‑ERROR
ENDLOOP
In this example, a panel is analyzed for field entries that violate the panel definition's validation rules or the application's rules. The panel is retransmitted until all input errors are corrected. The $PANEL‑ERROR function controls the exit from the loop for panel definition rules, while USER‑ERROR, defined in working data, controls the exit for application rules. USER‑ERROR is set to false before each TRANSMIT because the user can change field contents. It is re‑evaluated whenever the panel is processed.
If a value is not entered in Field‑2, the application supplies a default value. If this was the last panel definition violation, $PANEL‑ERROR becomes false. The application handles a test that is not supported (PNL‑FLD2 * 2) and, if it fails, sets USER‑ERROR to true, which requires the user to correct the entry.
Example of Help Processing:
<<A‑PNL>>
LOOP : User help and error analysis
SET USER‑ERROR = FALSE: Defined in working data
TRANSMIT PANEL‑A REINPUT
IF $PF1
TRANSMIT A‑HELP
PROCESS NEXT A‑PNL
ENDIF
SELECT
. . . (User error analysis)
ENDSELECT
WHILE $PANEL‑ERROR(PANEL‑A) OR USER‑ERROR
ENDLOOP
In this example, the end user has the option of invoking a help facility (PF1). Again, $PANEL‑ERROR and USER‑ERROR control the exit from the TRANSMIT loop. The REINPUT option is used with the TRANSMIT statement so that you do not need to reenter required fields each time through the loop.
Example of User Escape:
<<MENU‑SEL>> PROCEDURE
LOOP
TRANSMIT MENU
SELECT MENU‑OPTIONS
WHEN “1”
DO PROCESS‑ORDER
WHEN “2”
. . .
ENDLOOP
<<PROCESS‑ORDER>> PROCEDURE
LOOP
SET USER‑ERROR = FALSE : Defined in working data
TRANSMIT ORDER‑SC
. . . (User error analysis)
IF $PF24
RELEASE PANEL ORDER‑SC
QUIT PROCESS‑ORDER
ENDIF
WHILE $PANEL‑ERROR OR USER‑ERROR
ENDLOOP
. . . (Process order)
ENDPROC
In this example, the PROCESS‑ORDER procedure provides PF24 as a way for the user to escape from the current panel and go back to the MENU‑SEL procedure. This is helpful in preventing deadlock if incorrect data was entered and the user does not know the correct data.
|
Copyright © 2015 CA Technologies.
All rights reserved.
|
|