PUIATEXLAU – Retrieve Menu Item Launch State
This exit program is responsible for returning the launch ‘state’ and ‘text’ for a specific menu ‘code’ item.
This exit program goes really hand in hand with PUIATEXMNU. Where PUIATEXMNU is used to load the menu structure with each menu item having a unique ‘Code’, PUIATEXLAU uses this ‘Code’ or ‘ItemID’ to locate and find the launch settings for the menu item from the external database. This is then returned back to determine how Atrium will launch the menu item.
Below is exit program PUIATEXLAU procedure prototype.
D PUIATEXLAU PR ExtPgm('PUIATEXLAU') D iUser 128A Const D iItemID 128A Const D oLaunchConfig LikeDS(dsLaunchConfig) D oError N D oErrorMsg 256A
Dcl-PR Main ExtPgm('PUIATEXLAU'); iUser Char(128); iCode Char(128); oLaunchConfig LikeDS(dsLaunchConfig); oError Ind; oErrorMsg Char(256); End-PR;
Exit Program Parameter Descriptions
Parameter | Data Type (Length) | Description |
---|---|---|
iUser | Char(128) | User ID |
iItemID | Char(128) | Unique reference value for the menu item as assigned by PUIATEXMNU. |
oLaunchConfig | LikeDS(dsLaunchConfig) | Returned launch state and associate free text. Free text is shown in the dialog box. |
oError | Ind (true/false) | Returned from exit program. If 0 then success otherwise failure. |
oErrorMsg | Char(256) | Returned error message describing the error from exit program. |
Data structure definition that has return launch config for a passed ‘iItemID’ in the arguments.
// data structure for launch item config from exit program... D dsLaunchConfig DS Qualified D LaunchState 1A Inz('0') D LaunchText 512A Inz('')
Dcl-DS dsLaunchConfig Qualified; LaunchState char(1) Inz('0'); LaunchText char(512) Inz(''); End-DS;
The valid launch config values are defined in the below table. The external database will need to assign, for each menu item, the configs. The table below provides the details.
State | Text | Description (not a config item) |
---|---|---|
0 | No text required. | Launches item immediately |
1 | ‘Item needs confirmation’ free text field required. | Launches only if the user clicks ‘yes’ in the confirmation box. |
2 | ‘Item is unavailable’ free text field required. | Item does not launch. User can only click on ‘ok’ to close the dialog box. |