on 12-30-2014 11:59 AM
Hi,
The code below generates the Message Box shown.
Is it possible to change the title of the Message Box from "System Message" to say, "Update SAP" ?
Thanks.
Leon Lai
-------------------------------------
iReturn = SBO_Application.MessageBox("Update is irreversible!" & Environment.NewLine & _
"Do you want to continue?", 2, "Yes", "No")
Hi Leon,
it is possible - you could just catch the form loaded event and change the form to your needs. In ItemEvent Handler
if (pVal.FormTypeEx == "0" && pVal.EventType == SAPbouiCOM.BoEventTypes.et_FORM_LOAD && pVal.BeforeAction == false)
{
SBO_Application.Forms.Item(FormUID).Title = "My new title";
}
Of course you should set an indicator that it is you who opened the messagebox.
Btw there is a really good blog post about using messagbox as a true modal form :
http://scn.sap.com/community/business-one-sdk/blog/2013/04/04/true-modal-form-with-ui-api
regards,
Maik
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Leon,
There is no direct way of giving the title of the system message box.
the tricky part of the workaround is when you catch the form load event, you need to make sure that the form return by the pVal.FormUID is the correct form that you want to change.
One way is to get the reference of the form, read the message in the form and compare it with your original message.
If it matches then you can almost certain that this is the form you want to alter.
Regards
Edy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
97 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.