Maximo

Maximo

Come for answers, stay for best practices. All we're missing is you.

 View Only
Expand all | Collapse all

Why does service.error( ) convert the dialog title to lowercase?

  • 1.  Why does service.error( ) convert the dialog title to lowercase?

    Posted Sat December 18, 2021 10:08 AM
    Edited by System Admin Wed March 22, 2023 11:52 AM
    MAM 7.6.1.2:

    I have an automation script that intentionally throws an error under certain conditions:

    errorMsg = """
    \n Classification path has too many levels.
    """
    
    #Note: CLASSANCESTOR.HIERARCHYLEVELS start at 0, not 1. 
    #      So if there are "3" HIERARCHYLEVELS, then that means there are actually 4 levels.
    if mbo.getInt("CGCLASSANCESTOR_PARENTTOPLEV.HIERARCHYLEVELS") > 2: #Notice that the relationship points to the classstructure's *parent*.
        service.error("AutoSript: CGCLASSSTRUCTUREHIERARCHYPATH", errorMsg)
    
    mbo.setValue('CGHIERARCHYPATH', mbo.getString('HIERARCHYPATH'))​




    Question:

    When Maximo displays the error title in the dialog, it converts the text to lowercase, even though the title's text has uppercase letters in the underlying script.

    Why does Maximo convert the title to lowercase? (It doesn't do that for the text in the body of the message.)



    Thanks.

    #Maximo
    #AssetandFacilitiesManagement


  • 2.  RE: Why does service.error( ) convert the dialog title to lowercase?

    Posted Sun December 19, 2021 01:07 PM
    Hi,

    The error title that you are referring to is actually the message group and the message your are providing is the message key.  This is intended to look up a message from the MAXMESSAGE table, not to display the message directly.

    In the Database Configuration or Application Designer applications you will see an action menu item, "Messages", where you can add new messages that are defined with a message group, message key, and then the message value.

    If you had a message, with the following:

    Message Group: "custom"
    Message Key: "example"
    Message : An example of a custom message

    You could then call the following:

    service.error("custom","example")

    and the message "An example of a customer message" would be displayed.

    Hope that helps.

    - Jason

    ------------------------------
    Jason VenHuizen
    https://sharptree.io
    https://opqo.io
    ------------------------------