How to create a custom message and display it in a Maximo application

This entry is part of the Maximo Java Development series.

A typical need during Maximo application customization is the ability to display a message on the GUI.

The first step is to define the custom message. Open the Database Configuration application and select Messages for the Action menu. Create a new entry filling the required info:

  • Message Group: Messages can be categorized in groups. I typically put here the name of the customer that I’m working on. This allows to quickly list all the custom entries.
  • Message Key: Unique ID of the message. This field together with the MSGGROUP uniquely identifies the message. I typically use a short descriptive name of the message like ‘InfoMsg’ or ‘ErrorMsg’.
  • Display Method: Can be ‘MSGBOX’ or ‘STATUS’. The ‘MSGBOX’ display a standard popup window displaying the message and a set of customizable buttons. The ‘STATUS’ displays the text above the tool bar and does not require user intervention.
  • Message ID: Unique ID of the message. The typical format of custom messages is BMX[CC][NNNN][T] where [CC] is a two letters code that identifies your customization, [NNNN] is a four digits number and [T] is the type of message and can be E (Error), W (warning) or I (Info). Maximo suggest to use [CC]=’ZZ’ for custom messages. For example I have started my custom enumeration with code BMXZZ1001I.
  • Value: Text that will be displayed. Use {N} tags for parameters to be replaced at runtime (see example hereafter). Use \n to insert a newline.

Here is a screenshot of the new message.

Now that you have defined your message in the database it’s time to show it.
The technique to display the message is different whether you are in an AppBean or in a Mbo class.


If you are in a custom application bean class (extending AppBean) those two Java lines will bring up the custom message box.

String params[] ={"Hi there!"};
  clientSession.getCurrentEvent(), "MyGroup", "HelloMsg", params);

As you can see the {0} tag in the message will be replaced with the string ‘Bruno’ defined in the params array. Obviously it is possible to define multiple tags.

It is also possible to display this message box when an exception is thrown. For example the following two rows will display the same message but will also log a stacktrace in the system logs.

String params[] ={"Hi there!"};
throw new MXApplicationException("MyGroup", "HelloMsg", params);


If you are in an Mbo or MboSet (businessobject project) you can ‘attach’ the message to the MboSet with the MboSet.addWarning(MXException e) method.

String params[] ={"Hi there!"};
this.addWarning(new MXApplicationException("MyGroup", "HelloMsg", params));

Alternatively it is possible to throw an MXApplicationException like this.

String[] params = {"Hi there!"};
throw new MXApplicationException("MyGroup", "HelloMsg", params);
How to create a custom message and display it in a Maximo application

40 thoughts on “How to create a custom message and display it in a Maximo application

  1. Hi,
    Thanks for this valuable information.
    But, how can we display this message using the GUI Application Designer & Conditional Properties.

  2. Hi all,
    I want to custom by extend PO class, like this:

    public MboRemote createPOLineFromPR(MboRemote fromPR, MboRemote fromPRLine, MboSetRemote poLines) throws MXException, RemoteException
    String params[] ={"The siteid not match!"};
    showMessageBox(clientSession.getCurrentEvent(), "MyGroup", "HelloMsg", params);
    return null;

    return toPOLine;

    But, the error at "showMessageBox(clientSession.getCurrentEvent(), "MyGroup", "HelloMsg", params);"
    Could you please tell me how to fix.
    Thank so much

  3. The showMessageBox method is defined in application beans (extending psdi.webclient.system.beans.WebClientBean) and is not available in MBO beans (extending psdi.mbo.Mbo). In other words it can be used only in web classes, those contained in maximouiweb project.
    If you want to do a similar thing in an Mbo data bean you have to throw an exception.
    Look at this code snippet:

    String[] params = {"The siteid not match!"};
    throw new MXApplicationException("MyGroup", "HelloMsg", params);

    Please tell me if this works.

  4. Thanks Bruno Portaluri,

    It works in your case.

    MXApplicationException always stop and do nothing after show the message.

    But, I want to run next step after show the message.

    Can we have other ways?

    Thanks again for reply

  5. This ca be achieved by adding a warning message in the mbo code.

    mboremote.getThisMboSet().addWarning(new MXApplicationException("commlog","AccountManagerRoleNoLocationSpecified", params));

  6. I need show defsite in startcenter in the blue bar:

    Welcome, MAXADMIN
    Site BEDFORD

    Do you know it?



  7. Hi Bruno,

    I want an OK message to be displayed. But the processing should also continue. It should be in field class also. Is mboset.addWarning a solution for this?? But if you do this, it will affect at the time of save right?

  8. Yes it works . Its not stopping save. But now there is a new requirement. Put the same warning in bean class.

    I added the same line of code in bean class…..BUT NO POP came up plus its coming at the time of save. I want this message at the time of click of new row button.

  9. Hi Bruno,

    Great Post.

    I want to show a msg box while creating WO from SR(SR App), that shows Yes/no that displays if there is an open WO for that SR. Now if I select Yes, another WO is created and if I select No, WO is not created.

    I am entending the App Bean.

    I need to to know, How do I code for the YES and NO Selection

  10. Hi Bruno..I have a custom message with two buttons OK and CANCEL.If OK is clicked i need to perform a action and if CANCEL is clicked i need to perform another action through customization.How to capture the action performed?please help

  11. Bruno i wrote my code like this and my below messagebox displays two buttons OK and CANCEL but not YES/NO


    WebClientEvent event = clientSession.getCurrentEvent();

    int msgRet = event.getMessageReturn();

    and basing on the value in the msgRet by using another if,else condition i am performing someother action… but the problem here is

    the value in msgRet is -1 for the click performed on either OK or CANCEL…

    do i need to add any extra code to capture my event…i am a starter of maximo

    please help me how to capture the value of the event and procced further.

  12. Hi Bruno,

    My requirement is to display YES,NO exception in on click of change status button.
    If YES, is clicked, status should not be changed, if NO is clicked status should be changed.
    I have written the following code, but it goes into infinite loop,means the dialog box repeats itself again and again:

    if(getMbo().getUserInfo().isInteractive()) {
    int userinput = MXApplicationYesNoCancelException.getUserInput("SingleWOStatusChange", MXServer.getMXServer(),getMbo().getUserInfo());

    switch (userinput)
    case MXApplicationYesNoCancelException.NULL:
    if (wonums != "" ) {
    Object[] params = {wonums};
    throw new MXApplicationYesNoCancelException("SingleWOStatusChange", "wms", "validateLimitPOContract",params);
    case MXApplicationYesNoCancelException.NO:
    case MXApplicationYesNoCancelException.YES:
    no_times_contr_ref_warning_shown = 0;
    Utility.sendEvent(new WebClientEvent("dialogcancel", app.getCurrentPageId(), null, sessionContext));
    return EVENT_HANDLED;
    } //Try
    catch (MXException e)
    if(e instanceof MXApplicationYesNoCancelException)
    throw e;
    throw e;

    Please tell me how to rectify it.

  13. Hello,

    I want to simulate 'dialog close' event in the automation script. I believe this is the piece of code that can help me –

    Utility.sendEvent(new WebClientEvent("dialogclose", app.getCurrentPageId(), null, sessionContext));

    But I understand that app & sessionContext objects are not implicitly available to scripting framework.

    How can I achieve this using automation script?

  14. Referring from the DeveloperWorks Forum, some user posted below code –

    from psdi.webclient.system.controller import SessionContext, Utility, WebClientEvent
    from psdi.webclient.system.session import WebClientSessionManager

    uisessionid = "12"
    c = WebClientSessionManager().getWebClientSession(uisessionid)
    Utility().sendEvent(WebClientEvent("dialogok", c.getCurrentPageId(), None, SessionContext(c)))

    it works if I hardcode the uisessionid in the script as mentioned above. Is there any way to achieve this dynamically using automation script?

  15. Hi Bruno,

    I want to display a warning message on a dialog when i click on the OK button. But I am getting the message after the dialog is closed. Please Help…
    Can this be done in maximo?
    As I have not seen any scenerion where a warning message is thrown on a dialog on the click of OK button.

  16. I would think you might be able to achieve this using Database Configuration > Messages and setting a different value for:
    Message Group: login
    Message Key: welcomeusername

  17. I think this post may be due for an update to include discussion about the new Choice Message capability in 7.6. Its a nice addition. I have actually put an RFE in for IBM to enhance the capability and would love if anyone who can would vote for it. I want them to add the capability to put Text on a dialog window that we can use for Audit purposes. Just like Maximo already does for Status Changes and Admin Mode or DB Configs.

    Please help me by voting:

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to top