LogiView

Function 'mode'

     

This function returns a string with the short name of the current mode which is transferred from DataView to LogiView as first part of the standard parameters (output the complete standard parameter with the standard function par()). The standard parameter does not change during the complete runtime of the LogiView procedure, even if a new widget is opened in LogiView or another data record is selected or edited.

If LogiView has been started in editing mode - e.g. as pre- or post field trigger (using the userexits 'lgv_pre_fld' or 'lgv_post_fld') - the function returns one of the following strings:

I Insert
U Update

If LogiView has been started as edit, pre- or post action trigger (using the userexits 'lgv_edit_act', 'lgv_pre_act' or 'lgv_post_act') - the function returns one of the following strings:

Q Query
I Insert
U Update
C Copy (-> Edit Trigger only!)
T Temporary (temporary deletion)
R Rollback (Undelete)
D Delete (final deletion)

Starting with DTV300, mode() is able to evaluate a doubleclick mouseaction for records. In this case, mode() returns "U" and par() returns "ULines".

If a function is to be executed in "Q"uery mode, the query must not be "if (mode()=="Q")" but "if (par()=="Q")", since the LogiView function forwards the value "Q" in both the "Q"uery mode and in "U"pdate mode, if the saving process is aborted.
 

Syntax:

  {STR_VAR}= mode()
 

I/O parameters:

-  
-  
 

Return value:

 
{STR_VAR} Short name of the mode (Q, I, U, C, T, R, D or ++)
 

Example:

  Declaration of Variables
 
60 if (mode()=="++")

70   RES=@iwf_frm_ent("EDB-ARTICLE")

80 endif
  Result:
  This is a example for how to open the item form with LogiView after double clicking. The corresponding LogiView procedure has to be entered as "select action" userexit.

Functions and commands: Editing Masks