AlertBoxWithParams

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 AlertBoxWithParams(SalString sMessage, 
SalString sTitle,
SalNumber nFlags,
SalArray<SalString> sParam)

The AlertBox method shows a translated message with parameters to the user and returns the user's response.

Parameters

Name Description
SalString sMessage Message text shown to the user. The text may optionally contain placeholders &0, &1 etc. The placeholders are replaced with the parameters in sParam. This parameter should be a translatable constant.
SalString sTitle Text to be included in the title of the message box shown. This parameter should be a translatable constant. There are five predefined constants to use for this parameter: Const.CAPTION_Critical, Const.CAPTION_Error, Const.CAPTION_Information, Const.CAPTION_Question, Const.CAPTION_Warning to use with this parameter.
SalNumber nFlags Style of the message box that appears. This is a combination (using the Or (|) operator) for Const.MB_* constants. There are some predefined combinations constants Const.CRITICAL_*, Const.WARNING_*, Const.INFO_*, and Const.QUESTION_* available for use with this parameter.
SalArray<SalString> sParam Array containing the value parameters that should replace the placeholders.

Returns

The return value is Sys.IDABORT, Sys.IDCANCEL, Sys.IDIGNORE, Sys.IDNO, Sys.IDOK, Sys.IDRETRY or Sys.IDYES corresponding to the button the user pressed in response to the message.

Comments

This method works by replacing placeholders in the message text sMessage with the values of the replacement parameters sParam. A placeholders is an ampersand (&) character followed by a number. The number indicated what parameter value should replace the placeholder. For example &0 is replaced by sParam[0], &1 by sParam[1] etc.

To show a message without parameters, use the AlertBox method.

Example

! TEXT_QuestionSave = 'TEXT_QuestionSave: Do you want to save &0 changes in window &1?'
Set sParam[0] = SalNumberToStrX( nNumChanges, 0 )
Set sParam[1] = QualifiedItemNameGet( i_hWndFrame )
If AlertBox( TEXT_QuestionSave, CAPTION_Question, QUESTION_YesNo, sParam ) = ISYES
   Call SalPostMsg( i_hWndFrame, PM_DataSourceSave, METHOD_Execute, 0 )
C# code
// If none of selected projects has activities, the Activity Info is not started.
if (nSubProj == nSubProjWithoutAct) 
{
	// Call Console.Add('nSubproj = nSubProjWithoutAct')
	Ifs.Fnd.ApplicationForms.Int.AlertBox(Const.SUB_PROJECT_msgNoActivities,
Ifs.Fnd.ApplicationForms.Const.CAPTION_Warning, Ifs.Fnd.ApplicationForms.Const.INFO_Ok); Sal.WaitCursor(false); return false; } else if (nSubProjWithoutAct > 0) { // Call Console.Add('nSubProjWithoutAct > 0') sArray[0] = nSubProjWithoutAct.ToString(0); sArray[1] = nSubProj.ToString(0); Ifs.Fnd.ApplicationForms.Int.AlertBoxWithParams(Const.SUB_PROJECT_msgMissingActivity,
Ifs.Fnd.ApplicationForms.Const.CAPTION_Information, Ifs.Fnd.ApplicationForms.Const.INFO_Ok, sArray); }