Maximo Open Forum

 View Only
  • 1.  How To differentiate If PO is Revised or Duplicated at Automation script level.

    Posted 10-04-2022 05:25
    Hi Experts,

    I am working on Maximo 7.1.6.2.

    We have a requirement like "If PO is revised then increment the custom field(xyz) value to 1."

    To Achieve this I have created Object launch point Automation script on PO Object with Before save launchpoint condition. 

    sample script:
    from psdi.mbo import MboConstants
    if mbo.getString('STATUS') == 'PNDREV':
      mbo.setValue('XYZ',1,MboConstants.NOACCESSCHECK)

    If I tried to revise PO, The above piece of code is not setting value and not even satisfying the IF condition. the mbo.getString('STATUS') is returning the APPR status.

    To achieve this I also tried by creating script with PO.DUPLICATE this script is running when PO is revised or duplicated. Here also the mbo.getString('STATUS') returning APPR status. Here I am not able to differentiate the if it is duplicate or PO revision in script level. So there any way to increment the custom field(xyz) value if PO is revised.

    FYI: I have also tried Before save/ After save/ After commit launchpoint condition but not working.

    I would be great helpful if you provide any suggestions on it. :)
    #Administration
    #Analytics
    #Architecture
    #Assets
    #CivilInfrastructure
    #Customizations
    #EndUser
    #EverythingMaximo
    #HSE/OilandGas
    #Infrastructure
    #Integrations
    #Inventory
    #IoT
    #LifeScience/Calibration
    #Linear
    #MaximoApplicationSuite
    #MaximoForAviation
    #MaximoUserGroups
    #Mobility
    #Nuclear
    #Procurement
    #Reporting
    #Scheduling
    #Security
    #ServiceProvider
    #Spatial
    #Transportation
    #Utilities
    #WorkCenters
    #WorkManagement

    ------------------------------
    Venkatrao Y
    ------------------------------


  • 2.  RE: How To differentiate If PO is Revised or Duplicated at Automation script level.

    Posted 10-04-2022 09:53
    Hi Venkatrao,
    Have you checked out the PO.POREVISIONNUM field? It seems like its doing exactly what your custom requirement is asking for.  I dont think you need to create a script for this at all.

    Field Help:
    Revision number of the purchase order. Indicates how many times a purchase order has been revised. A purchase order that has not been revised displays 0 for the revision number.

    Thanks
    Eric Godel


    ------------------------------
    Eric Godel
    Bay Systems Consulting
    ------------------------------



  • 3.  RE: How To differentiate If PO is Revised or Duplicated at Automation script level.

    Posted 10-04-2022 11:45
    Hi Eric,

    Thanks for replying :)

    Here we are incrementing the custom attribute of po if po is revised or receipts are completed or po is approved.
    We are able to increment custom field by crating object launch point script if po receipts are completed or po is approved but if po is revised then we are not able to increment the custom field value.

    And also I have checked that isModified(“STATUS”) condition also while revising po but it is return false value and if I display status it is showing APPR and if is display revision number the same current approved revision number is displayed.
    IsModified() is not working on status and revision number while revising po.

    Sent from my iPhone




  • 4.  RE: How To differentiate If PO is Revised or Duplicated at Automation script level.
    Best Answer

    Maximo Certified
    Posted 10-04-2022 10:23
    In the PO.DUPLICATE script, you can determine if you're in the process of revising by doing something like:

    from psdi.server import MXServer

    if MXServer.getBulletinBoard().isPosted("po.REVISEPO", mbo.getUserInfo()):


    What I don't understand is why your status would be APPR at the before save event. As part of the revise PO action it should be setting it to PNDREV before the save occurs.

    ------------------------------
    Steven Shull
    IBM
    ------------------------------



  • 5.  RE: How To differentiate If PO is Revised or Duplicated at Automation script level.

    Posted 10-04-2022 12:03
    Hi Steven,

    Thank you !

    It is Working :)

    from psdi.server import MXServer
    if MXServer.getBulletinBoard().isPosted("po.REVISEPO", mbo.getUserInfo()):

    Above if condition is working only for revise PO but not duplicate.


    ------------------------------
    Venkatrao Y
    ------------------------------



  • 6.  RE: How To differentiate If PO is Revised or Duplicated at Automation script level.

    Maximo Certified
    Posted 10-05-2022 19:06
    Hi Venkatrao

    I'm glad that Steven was able to give you your answer.  However, I'm interested in the business case and why the PO revision number is insufficient to meet the requirement.  I say this because if you revise a PO the revision number is incremented by 1, whereas for a duplicate the revision number starts at 0. So, let's agree that this actually has nothing to do with duplication.

    Is the use case actually "If a PO is revised, set the XYZ to 1 on the PO from which it is being revised"  In other words, PO 12345 Rev=0 status=APPR XYZ=0 from which a revision is generated.  That resulting revision PO 12345 Rev=1 status=PNDREV XYZ=1 and the original PO 12345 Rev=0 status=APPR XYZ=0 or is it revision PO 12345 Rev=1 status=PNDREV XYZ=0 and the original PO 12345 Rev=0 status=APPR XYZ=1

    On approving the revision, the result will be:
    PO 12345 Rev = 0 status=REVISED XYZ=1
    PO 12345 Rev = 1 status=REVISED XYZ=0

    So, extending that by revising again:
    PO 12345 Rev = 0 status=REVISED XYZ=2
    PO 12345 Rev = 1 status=REVISED XYZ=1
    PO 12345 Rev = 2 status=APPR XYZ=0

    Then, extending that by revising again:
    PO 12345 Rev = 0 status=REVISED XYZ=3
    PO 12345 Rev = 1 status=REVISED XYZ=2
    PO 12345 Rev = 2 status=REVISED XYZ=1
    PO 12345 Rev = 3 status=APPR XYZ=0

    Let's reflect back on what you said was the requirement "If PO is revised then increment the custom field(xyz) value to 1."  What tiny bit is missing in this communication is if this XYZ field increment is to be done on the revision=0 PO or for each PO revision??  What is the intended value of the XYZ field to the business when there is the existing revision number?

    ------------------------------
    Regards,
    Craig Kokay
    ISW
    Maximo Practice Manager
    eMail: ckokay@isw.net.au
    Phone: +61-411-682-040

    #IBMChampion2022
    ------------------------------