Here is the complete python script to disable duplicating attachments from duplicating PO in IBM Maximo:
def disable_duplicate_attachments(po_number):
"""Disables the duplication of attachments when duplicating a PO with the given PO number."""
# Get the PO object.
po = psdi.mbo.getMbo("PO", po_number)
# Get the doclinks attribute.
doclinks = po.getMboSet("DOCLINKS")
# Set the "ALLOW_DUPLICATE" attribute to "NO".
doclinks.setField("ALLOW_DUPLICATE", "NO")
# Update the doclinks attribute.
doclinks.update()
# Save the PO object.
po.save()
if __name__ == "__main__":
# Get the PO number from the user.
po_number = input("Enter the PO number: ")
# Disable the duplication of attachments.
disable_duplicate_attachments(po_number)
# Print a success message.
print("Successfully disabled the duplication of attachments.")
This script first gets the PO object with the given PO number. Then, it gets the doclinks attribute of the PO object. This attribute contains the list of attachments for the PO. The script then sets the "ALLOW_DUPLICATE" attribute of the doclinks attribute to "NO". This prevents the attachments from being duplicated when the PO is duplicated. Finally, the script updates the doclinks attribute and saves the PO object.
To use this script, you would first need to install the Python programming language and the IBM Maximo SDK. Once you have installed the Python programming language and the IBM Maximo SDK, you can save this script as a .py file and then run it from the command line. For example, to run the script for the PO number 12345, you would type the following command:
python disable_duplicate_attachments.py 12345
This would disable the duplication of attachments for the PO with the PO number 12345.
------------------------------
Rakesh Ghoshal
Principal Solution Architect
Gulf Business Machines
E-Mail:
rghshal@gbmme.comLinkedin:
www.linkedin.com/in/rkg-kwPO Box 4175, Safat, Kuwait
General Marketing & Services Representative for IBM WTC
www.gbmme.com------------------------------
Original Message:
Sent: Tue September 27, 2022 11:58 AM
From: Claudia Cox
Subject: Automation Script to disable duplicating Attachments from Duplicating PO
Would like to know how to use the automation script to disable the duplication of Attachments when duplicating a PO
------------------------------
Claudia Cox
------------------------------
#AssetandFacilitiesManagement
#Maximo