Maximo

 View Only
  • 1.  How can we throw a system error message using script for integration

    Posted Tue May 23, 2023 09:32 AM

    Say we are creating a script for Object Structure Inbound processing and we are doing validations in beforeCreateMboset method, if we encounter a situation where in we want to throw an error message , how can we do that.
    I tried service.error but it doesnt seem to work. Is there any way we can throw error message and not skip the transaction.



    ------------------------------
    Akshay T
    ------------------------------

    #Maximo
    #MaximoIntegrationandScripting


  • 2.  RE: How can we throw a system error message using script for integration
    Best Answer

    Posted Wed May 24, 2023 08:02 AM

    Your declaration of your function will look something like:

    def beforeCreateMboSet(ctx):

    ctx is an extension of the ScriptService class. You can call any of the methods available via the service variable using the name of the parameter like ctx in this case. I could call ctx.error("emx","myErrorMessage") for example. 



    ------------------------------
    Steven Shull
    ------------------------------



  • 3.  RE: How can we throw a system error message using script for integration

    Posted Wed May 24, 2023 03:21 PM

    Thanks Steve for that insight



    ------------------------------
    Akshay T
    ------------------------------