SessionModalDialog

Note: This page includes content based on the F1 documentation for Centura development. It may be partially converted to support APF development, but should be regarded to be of uncertain actuality. It is provided as is. Eventually, it should be replaced by documentation available from within Visual Studio.

SalNumber SessionModalDialog( SalString sDialogName,
		           SalWindowHandle hWndParent )

The SessionModalDialog method creates modal dialog boxes at runtime, transferring all "globals".

Parameters

Name Description
SalString sDialogName Name of the dialog box to be created. This parameter should be a packed message if globals are meant to change.
SalWindowHandle hWndParent The handle (or name) of the owner window. Specify hWndNULL if there is no owner window.

Returns

The return value is the value specified in the second parameter of SalEndDialog (hWndOwner). nReturn is equal to -1 if the dialog box is not created.

Comments

Applications should use SessionModalDialog instead of SalModalDialog where it is desirable that the created dialog gets the same user globals (e.g. COMPANY_ID and PROCESS) as the window from which it was created.

If any of the user globals should be converted to another value during the startup this can be done by passing a packed message instead of just a window name. The message passed should contain beside the START_WINDOW attribute that should contain the name of the window to start. Also any global to change as an attribute. Both Pack and PackComment messages are recognized.

It is not possible to create dialogs with parameters using SessionModalDialog.

Example

Function: UM_TransferToFinance
   Actions
       ! Start the customer details window
       If SessionModalDialog( 'dlgTransferToFinance', hWndMDI ) = IDOK
          Return TRUE
       Else
          Return FALSE 
       ! Start Tab window for other COMPANY global
       Call Msg.Construct( ) 
       Call Msg.AddAttribute( 'START_WINDOW', 'dlgTransferToFinance' )
       Call Msg.AddAttribute( 'COMPANY', '03' )
       Return SessionModalDialog( Msg.Pack( ), hWndMDI ) 
C# coding sample
case Ifs.Fnd.ApplicationForms.Const.METHOD_Execute:
	sItemNames[0] = "EMP_NO";
	hWndItems[0] = colsEmpNo;
	Ifs.Fnd.ApplicationForms.Var.DataTransfer.Init("PosAssign", this, sItemNames, hWndItems);
	return SessionModalDialog("dlgAssignFormerEmpWizard", Sys.hWndMDI);
............