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.auPhone: +61-411-682-040
#IBMChampion2022
------------------------------
Original Message:
Sent: 10-04-2022 05:25
From: Venkatrao Y
Subject: How To differentiate If PO is Revised or Duplicated at Automation script level.
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
------------------------------