PeopleSoft-警告、错误、消息盒子
PS页面中配置提示消息路径:
根据消息严重性不一样,会有不同的结果。1.取消;2.消息;3.警告;4.错误;不同的消息,程序会根据不同的严重性进入不同的步骤(MsgGet、MsgGetExplainText对此方法无效,仅对Messagebox有效)。
- 显示消息并且强制取消程序;
- 显示消息并继续处理;
- 显示消息并视为警告;
- 显示消息并视为错误;
Messagebox、winMessage类在以下类型中不回被触发;
SavePreChange.
Workflow.
RowSelect.
SavePostChange.
Any PeopleCode event that fires as a result of a ScrollSelect (or one of its relatives) function calls, or a Select (or one of its relatives) Rowset class method.
Messagebox
1 | MessageBox(style, title, message_set, message_num, default_msg_txt[, paramlist]); |
- messagebox不同buttons类型:
Category | Value | Constant | Meaning |
---|---|---|---|
Buttons | 0 | %MsgStyle_OK | The message box contains one push button: OK. |
1 | %MsgStyle_OKCancel | The message box contains two pushbuttons: OK and Cancel. | |
2 | %MsgStyle_AbortRetryIgnore | The message box contains three pushbuttons: Abort, Retry, and Ignore. | |
3 | %MsgStyle_YesNoCancel | The message box contains three pushbuttons: Yes, No, and Cancel. | |
4 | %MsgStyle_YesNo | The message box contains two push buttons: Yes and No. | |
5 | %MsgStyle_RetryCancel | The message box contains two push buttons: Retry and Cancel. |
- messagebox不同buttons类型的返回值(数值型):
Value | Constant | Meaning |
---|---|---|
-1 | %MsgResult_Warning | Warning was generated. |
1 | %MsgResult_OK | OK button was selected. |
2 | %MsgResult_Cancel | Cancel button was selected. |
3 | %MsgResult_Abort | Abort button was selected. |
4 | %MsgResult_Retry | Retry button was selected. |
5 | %MsgResult_Ignore | Ignore button was selected. |
6 | %MsgResult_Yes | Yes button was selected. |
7 | %MsgResult_No | No button was selected. |
winmessage
1 | //一般用于调试测试使用; |
Warning
1 | //一般在报表中使用警告; |
Error
1 | Error("错误内容是啥呢~~") |
MsgGet
1 | //无论消息的严重性如何,只做获取消息; |
MsgGetExplainText
1 | //无论消息的严重性如何,只做获取消息;获取消息的同时,可以动态替换消息内容; |
注意
MessageBox、Warning、winmessage函数不会终止程序;Error会终止程序。当然,根据选择的不同的消息严重性也会结果不同,例如:MessageBox采用的消息如果严重性时取消或者错误,也会终止程序。
一切内容以PeopleBook中的内容为准: