# Userexits

Modules | Functions

## Menu userexits

### Modules
| Select-Menu userexits
| No-Select-Menu userexits
| Edit-menu userexits
### Functions
int | lgv_usx_cre_var ()
| Creates a LGV-variable and assigns it to SYSTEM, logic model, or decision table.
int | xatt_qry_cls ()
| userexit iwf_exi_edt(F) is replaced by xatt_qry_cls in the pre-mask userexit xatt_prm.
int | xchg_cfg_check (const char *param, const char *ignore)
int | xchg_opr_get_val (const char *param, const char *ignore)
int | xcnf_cps_elm_sol_edt (const char *param, const char *ignore)
int | xdfv_wri_def_val (const char *param, const char *ignore)
static int | xhlp_set_vwr ()
| Sets the viewer used to display an online help page.
int | xknl_itm_del_rel (const char *param, const char *ignore)
int | xord_cpy_ord ()
| Menu userexit to copy all data of an order.
int | xqry_del ()
| Menu userexit to delete a stored query or favorite in Favorites->Administrate form and additionally removes the correspondent browser records.
int | xqry_exc ()
| Menu userexit to execute the query conditions in direct search or rank mode.
int | xrel_cnt_mul ()
| Counts the records in the multi list with the given attributes and writes the result into the message window.
int | xrel_del_ref ()
| Menu userexit to delete the relation for the elements in the given refine relation.
int | xrel_exp ()
| Expands an entry of a multi list.
int | xrel_lis_agg_mul ()
| Creates the aggregate list widget to the repeated reference.
int | xrel_lis_ref_mul ()
| Creates mask widget to the references with the given view.
int | xrel_mul_cln ()
| Cleans up all double assigned entities of a multi-list.
int | xrel_upd_mul ()
| Searches with the given attributes and writes the record(s) in the mask.
int | xver_upd_cur_flg ()
| Userexit for parallel versioning.
int | xwfl_editor_start ()
| Userexit to start the workflow editor on Unix or MS-Windows.
int | zag_get_rec ()
| Executes a search request for the passed field and search string.

### Function Documentation

int lgv_usx_cre_var | ( | ) |

Creates a LGV-variable and assigns it to SYSTEM, logic model, or decision table.

The variable is assigned only if the previous vraiable creation was successful.

Parameters:

  cp_arguments | Standard argument string. Syntax like:
  "NAME | /TYP=val {/SYS | /LM=<lm> | /DT='<lm>/<dt>'}
  /DEF=val | /SIZ=no /ACC=dbaccess /COM=comments /PAR=no"
  with,: |
  NAME | Variable name
  TYP=val | Variable type
  SYS | System variable
  LM=<lm> | Logical model name
  DT='<lm>/<dt>' | Name of the logical model/procedure |  | DEF=val | Default value |  | SIZ=val | Array size if the variable is of array type |  | ACC=access | Database access |  | COM=comment | Variable description |  | PAR=no | Parameter number if the variable is passed by another LogiView procedure

Returns:

  0 | OK
  Else | Error

int xatt_qry_cls | ( | ) |

userexit iwf_exi_edt(F) is replaced by xatt_qry_cls in the pre-mask userexit xatt_prm.

The usrexit parameter is passed from pre-mask userexit xatt_prm.

Parameters:

  param | Parameter for the userexit, syntax like: /SUB opens list EDB-GRP-ent-SUB-RLI where ent is the short entity name (e.g. EDB-GRP-ART-SUB-RLI for items entity EDB-ARTICLE) /SUB /SUBLIS opens the folder r EDB-GRP-ent-SUB-RLIC

Returns:

  0 | Ok.
  1 | Error

See also:
  xatt_prm

int xchg_cfg_check | ( | const char * | param,
|  | const char * | ignore
| ) |  |

Checks whether the combination entity1/entity2/view is controlled by the Change Management.

The menu userexit to check whether the combination entity1/entity2/view is controlled by the Change Management configuration.

Parameters:

  context | Context of the userexit
  param | Parameter with syntax like: /EN1=<entity1> [/EN2=<entity2> /VIEW=<view>]
  EN1 | entity1 | Name of entity1
  EN2 | entity2 | Name of entity2
  VIEW | view | Name of view
  | Do not pass options EN2 and VIEW for entity configurations

Returns:

  0 | Combination is NOT controlled by the Change Management
  1 | Combination IS controlled by the Change Management

int xchg_opr_get_val | ( | const char * | param,
|  | const char * | ignore
| ) |  |

LogiView userexit to read from the change operation LUT cache.

Parameters:

  context | Action userexit context
  param | LogiView parameter string consisting of: Change operation type ID [Integer, INPUT] Attribute name [String, INPUT] Attribute value [String, OUTPUT]

Returns:

  0 | OK
  Else | Error

Exceptions:

  NoSuchElementException | Invalid ID
  NoSuchFieldException | Attribute not found

int xcnf_cps_elm_sol_edt | ( | const char * | param,
|  | const char * | ignore
| ) |  |

Select-Menu userexit for product structure element.

Parameters:

  param | Standard userexit parameter (reserved).

Returns:

  0 | OK
  1 | Error

int xdfv_wri_def_val | ( | const char * | param,
|  | const char * | ignore
| ) |  |

Button or menu userexit for setup form to write defaults to the database.

The modified values of all defaults are read from the widget buffer and written into the database and memory. If no parameter is passed the current user is used.

Parameters:

  ctx | Menu userexit context.
  param | Parameter to control the behavior of this userexit. Syntax is: "[/GLOBAL|/USER=<userName>]" With possible arguments:
  GLOBAL |  | Sets the default as GLOBAL.
  USER | username | Sets the default for the user with passed name.

Returns:

  0 | OK
  1 | Error

static int xhlp_set_vwr | ( | ) | `[static]`

Sets the viewer used to display an online help page.

This userexit may only be used from the LogiView procedure `EP_HLP/GetViewer`, which is called when processing a call to `hlp_cal_txt`.

It parses the option string and stores the values in an internal variable. This information is used to start the help viewer later in the process.

Parameters:

  cpPar0 | option string with viewer settings. Syntax is: "/NAME=<name> /PATH=<path> /OPT='<options>' /IPC={CMD|DDE|NETSCAPE} /VIEW_MODE={ACT|NEW}" With possible arguments
  NAME | name | IPC name of the HTML viewer (for example Netscape)
  PATH | path | Local path to the viewer executable
  OPT | options | Command line options to pass to the viewer
  IPC |  | IPC mode for this viewer:
  | CMD | Simple command line interface
  | DDE | Windows DDE interface
  | NETSCAPE | Netscape's remote protocol on Unix
  VIEW_MODE | ACT - use the actual viewer window (default)
  | NEW - open a new viewer window
  cpIgn | Reserved

Returns:

  0 | OK

int xknl_itm_del_rel | ( | const char * | param,
|  | const char * | ignore
| ) |  |

Menu userexit to remove a relationship between item master and a basic unit.

Parameters:

  context | Context of the userexit
  param | Standard parameter (reserved)

Returns:

  0 | OK
  Else | Error

int xord_cpy_ord | ( | ) |

Menu userexit to copy all data of an order.

Note:
  It is only possible to copy one order at a time (if several orders are selected only the first one will be copied).

Parameters:

  cp_Parameter | Parameter to control the behavior of this function. Syntax is: "<relation> /OPN_USX=<usx> /PRM_USX=<usx>[(<param>)] /CALL=<usx>[(<param>)] /CLOSE=<usx>[(<param>)] [/ALL]" With possible arguments:
  | relation | Name of relation to open widget, usually the same syntax like iwf_lis_ref(). You may use "EDB-ARTICLE STR" or "EDB-ARTICLE STR EDB-ART-STR-RLI" for example.
  OPN_USX | usx | Name of userexit to use to open the passed relation. If this option is not set, the standard function iwf_lis_ref() will be used.
  PRM_USX | usx(param) | Name (and optional parameters) of the pre-mask userexit to be called. If this option is not set, the standard pre-mask userexit will be used. If "NO" is passed as the userexits name, no pre-mask userexit will be called.
  CALL | usx(param) | Name (and optional parameters) of userexit to be called after query has been executed in current relation widget.
  CLOSE | usx(param) | Name (and optional parameters) of userexit to be called before the relation widget will be closed again.
  ALL |  | Copy all relations of selected record by calling xedb_dup_ref("/ALL"). If option is not set, copy refine relations of selected record (xedb_dup_ref("/MODE=R")) only.

Returns:

  0 | OK
  1 | Copy failed.

see xedb_dup_ref xedb_tre_wlk

int xqry_del | ( | ) |

Menu userexit to delete a stored query or favorite in Favorites->Administrate form and additionally removes the correspondent browser records.

Parameters:

  cp_Arguments | Userexit parameter, not used yet.

Returns:

  0 | OK
  Else | Error

int xqry_exc | ( | ) |

Menu userexit to execute the query conditions in direct search or rank mode.

Chooses the adequate xqry-function for the given mode.

Example:

Parameters:

  cp_Par |
             Parameter to control the behavior of
                              this userexit - (Reserved).

Returns:

      0  OK

      1  Error

int xrel_cnt_mul | ( | ) |

Counts the records in the multi list with the given attributes and writes the result into the message window.

Returns:

  1 | OK

int xrel_del_ref | ( | ) |

Menu userexit to delete the relation for the elements in the given refine relation.

Using the option "/MODE=E" may be used to delete the related elements themselves. When deleting related elements, make sure they are not used anymore!

Parameters:

  cp_par | Parameter to control the behavior of this userexit. Syntax like: "ENTITY2 VIEW [/MODE={R|E}]"

With possible arguments

ENTITY2 |  | Entity 2 to open the refine list with `iwf_lis_ref`.
VIEW |  | View to open the refine list with `iwf_lis_ref`.
MODE | R|E | Indicates if the master records of the related elements themselves are to be deleted (R = references only, E = elements).

Returns:

  0 | OK
  2 | Error in call of xedb_del_tra_rel
  Else | Error code

int xrel_exp | ( | ) |

Expands an entry of a multi list.

There are four expansion methods:

- EXPAND
  First you can expand only one level. Therefore, only the directly related records (for certain entities, see below) are inserted into the multi-list.

- EXPAND_AND_DELETE
  The system prompts if the starting element from the multi list has to be deleted (Y/N). This prompt only appears when the virtual mode is not set.

- EXTRACT
  Additionally you can define, to delete the starting element from the multi list.

- RESOLVE
  This method expands all levels and all entities.

Predefined relations can be used according to the main CADIM/EDB entities. These relations are:

- EDB-PROJECT -> EDB-PROJECT STR
- EDB-PROJECT -> EDB-ARTICLE STR
- EDB-PROJECT -> EDB-DOCUMENT STR
- EDB-ARTICLE -> EDB-ARTICLE STR
- EDB-ARTICLE -> EDB-DOCUMENT STR
- EDB-DOCUMENT -> EDB-DOCUMENT STR
- EDB-DOCUMENT -> EDB-FILE STR

Alternatively, another set of relations can be defined for any entity. For this purpose an entry in the configuration table T_CFG_DAT has to be created. The configuration id has to have the name:

        MUL_EXP_entity

(For example MUL_EXP_EDB-PROJECT). The configuration value consists of a comma separated list with the names of the related entities:

        sub_entity1 [view] [, sub_entity2 [view] ...]

(For example EDB-ARTICLE, CUSTO_ENTITY VIEW2, EDB-DOCUMENT STR). If you do not set the name of the view of the relation, it is assumed to be STR.

You can mix these two possibilities, using the predefined values for all or most of the above CADIM/EDB entities and adding some entities with their relations in the configuration table.

Parameters:

  cp_Parameter | Parameter to control the behavior of this userexit. Syntax like: "EXPAND|EXPAND_AND_DELETE|EXTRACT|RESOLVE"

With possible arguments:

EXPAND |  | Expands all entities on the next level and leaves the starting element in the list.
EXPAND_AND_DELETE |  | Expands all entities on the next level and confirms if the starting element in the list will be deleted.
EXTRACT |  | Expands all entities from the next level and deletes the starting element from the list.
RESOLVE |  | Expands all entites from all levels (Full-Tree Scan) and leaves the starting element in the list.

Returns:

  0 | Ok
  1 | Error

int xrel_lis_agg_mul | ( | ) |

Creates the aggregate list widget to the repeated reference.

Parameters:

  cp_Name | Parameter to control the behavior of this userexit. Syntax like: "entityName"

With possible arguments:

entityName |  | Name of the entity.

Returns:

  0 | Ok
  -1 | Field "C_ENTITY" not in aggregate mask
  else | Error from function `iwf_lis_agg"`

int xrel_lis_ref_mul | ( | ) |

Creates mask widget to the references with the given view.

Parameters:

  cp_Name | Parameter to control the behavior of this userexit. Syntax like: "maskName view [parentEntity parentCid]"

With possible arguments:

maskName |  | Name of the mask to create.
view |  | Name of the view to use.
parentEntity |  | Optional name of the parent entity.
parentCid |  | Optional C_ID of the parent element.

Returns:

  0 | OK
  1 | No parameter
  2 | Cannot create mask

int xrel_mul_cln | ( | ) |

Cleans up all double assigned entities of a multi-list.

Can be called from the NoSel-Menu of the multi-list.

Returns:

  0 | Ok
  1 | Error

int xrel_upd_mul | ( | ) |

Searches with the given attributes and writes the record(s) in the mask.

Remarks:
  After searching the post-action userexit is executed.

Returns:

  0 | OK
  1 | Mul-Id not found in mask buffer
  2 | Parent entity not found
  -1 | Not all found records can be loaded

int xver_upd_cur_flg | ( | ) |

Userexit for parallel versioning.

This userexit is used for setting the value for current flag for all elements which have the same index fields (e.g. the current element except for the fields defined with '/NO_KEY').

Parameters:

  cpParameter | Parameter to control the behavior of this function. Syntax is: "value /TAB=table /ROW=row /NO_KEY=fields" With possible arguments:
  | value | Logic value to be set for current flag.
  TAB | table | Name of table (e.g. T_DOC_DAT).
  ROW | row | Row number.
  NO_KEY | fields | Names of index fields (separated by comma) where value must be different from current element (while all other values must be identical with current element).

Example:
  When called in LogiView, this userexit is used like this:

         EP_STRING = strprint ("y /TAB=T_DOC_DAT /ROW=%i
                                /NO_KEY=T_DOC_DAT.DOC_VERSION", row())
         RES = @xver_upd_cur_flg (EP_STRING)

Returns:

  0 | Ok.
  1 | Error

int xwfl_editor_start | ( | ) |

Userexit to start the workflow editor on Unix or MS-Windows.

Parameters:

  cpPar | Parameter to control the behavior of this userexit. Syntax like: "/MODE=external|console [PRC_ID=id] [/DBG]" With possible arguments:
  MODE | external|console | Determines the mode to present the workflow editor. -In `external` mode the editor is starting as standalone application. -The `console` mode displays a text console that displays the Java virtual machine output messages.
  PRC_ID | process Id | The id of the process that is opened. If this option is omitted, the workflow editor is started with no process opened.
  DBG |  | Displays some debug messages in the DataView client message window

Returns:

  0 | OK
  1 | Error

int zag_get_rec | ( | ) |

Executes a search request for the passed field and search string.

To select the first field in the mask use "0" as field number (/FLD=0). If no field number is passed the first field in the mask is used.

Parameters:

  cpPar | Parameter to control the behavior of this function. Syntax like: "Search-String [/FLD=<Number>] [/WCD=<Wildcards>] With possible arguments:
  | Search-String | e.g. A%
  FLD | FieldNumber | e.g. /FLD=5
  WCD | Wildcards | e.g. /WCD=?%

Returns:

  0 | Success
  1 | Error

Example:

        // get all records the value starts with 'A' in the 5 field of the widget.
        iRC = zag_get_rec ("A% /FLD=4");

Copyright © 2007-2012, Oracle and/or its affiliates.