Maximo Integration

  • 1.  Automation script to set GL account based on Desktop requisition line type.

    Posted Thu March 11, 2021 04:20 AM
    Hello Community,
    I am a trying to create automation script that set GL account
    based on desktop requisition line type.

    Up to now I have managed set GL account value, but can not be changed.
    If I change the value, and for example client and change reservation type,
    old value that is set by auto script is backed.
    Script uses attribute launch point.

    Here is script that I have created:

    from psdi.mbo import MboConstants
    if (mbo.getString("LINETYPE")== 'SERVICE'):
        # we are using single GL segment
        mbo.setValue("GLDEBITACCT", "6039001",MboConstants.DELAYVALIDATION)
    else:
       print "Check for next doc type"

    I have checked with different MboConstants, but only with DELAYVALIDATION I was able to set
    value for GL field. Also tried to play with GLFormat and define array and to assign that value to GL account also not working.

    Thank you in advance
    Chavdar


      


    ------------------------------
    Chavdar Cholev
    Openintegra
    Sofia
    ------------------------------


  • 2.  RE: Automation script to set GL account based on Desktop requisition line type.

    Posted Thu March 11, 2021 11:06 AM
    You say this is on an Attribute Launch Point, I assume that's configured on the LINETYPE attribute and using On Validate? 

    The logic looks right, though I've never used DELAYVALIDATION. I typically use some combination NOVALIDATION, NOACTION, or NOACCESSCHECK.

    I think your problem may actually be with using a Drop Down (COMBOBOX) control and the Attribute Launch Point with On Validate (On Validate doesn't seem to fire with COMBOBOX). You may have to either trigger with an Object Launch Point On Save, or edit the App XML to use a Textbox control.

    ------------------------------
    Tim Ferrill
    Solutions Consultant
    Intelligent Technology Solutions
    tferrill@webuildits.com
    www.webuildits.com
    @tferrill/@webuildits
    ------------------------------



  • 3.  RE: Automation script to set GL account based on Desktop requisition line type.

    Posted Fri March 12, 2021 01:45 AM
    Hi Tim,
    Thank you for your answer. Just to test, I have added a custom filed GL_TEST
    and modified script to point that filed in mbo.SetValue line and it works.
    The difference is GLDEBITACCT is from GL type, while test filed is from string.
    I will give a try with another test field with teh same type of GL to make sure
    if field type could cause problem,

    Thank you once again & have a nice day
    Chavdar





  • 4.  RE: Automation script to set GL account based on Desktop requisition line type.

    Posted Fri March 12, 2021 10:50 AM
    That's interesting. I always use setValue() with a string value when working with GL's. I'd be more inclined to think this is related to your access modifiers rather than a string issue.

    This is a line of code from a working script we have On Save on the WORKORDER Object:
    mbo.setValue("GLACCOUNT", mbo.getString("PARENT.GLACCOUNT"))

    ------------------------------
    Tim Ferrill
    Solutions Consultant
    Intelligent Technology Solutions
    tferrill@webuildits.com
    www.webuildits.com
    @tferrill/@webuildits
    ------------------------------



  • 5.  RE: Automation script to set GL account based on Desktop requisition line type.

    Posted Fri March 12, 2021 11:00 AM
    We set the GL Debit on an MR Line based on the FINCNTRL (Project / Cost Management Module) and it works using setValue, here is the snippet:

    mbo.setValue("GLDEBITACCT", finCntrl.getString("GLACCOUNT"), MboConstants.NOACTION+MboConstants.NOACCESSCHECK)

    You shouldn't need to use delayvalidation on this, that will just delay the attribute validation until save on the main object. I see no reason to do that on the GL.

    ------------------------------
    Daniel Gruszka
    ------------------------------