I'm after some help with creating an automation script that will transfer the workorder actfinish date to a custom field on the associated location record.
I'm a complete novice at scripting and have been researching on the web with little success.
I've created a button on the workorder screen which can be pressed to run the update script, I'll probably replace this to run when the workorder status changes in the future.
So far i've got this far but it doesn't seem to like using LOCATIONS.VISINSPDATE
from psdi.mbo import MboConstants
# Set the locations last visual inspection date the same as actaul finsih date of the workorders based on the ex inspection type when a work order is closed if it is gretaer than the current value
if ((LOCATIONS.VISINSPDATE is None or LOCATIONS.VISINSPDATE > actfinish) and WORKORDER.WO11 == 'VISUAL INSP OK'):
mbo.setValue("LOCATIONS.VISINSPDATE",actfinish);
# Set the locations last visual inspection date the same as actaul finsih date of the workorders based on the ex inspection type when a work order is closed if it is gretaer than the current value
elif ((LOCATIONS.DETINSPDATE is None or LOCATIONS.DETINSPDATE > actfinish) and WORKORDER.WO11 == 'DETAILED INSP OK'):
mbo.setValue("LOCATIONS.DETINSPDATE",actfinish);
else:
------------------------------
Richard White
------------------------------
#AssetandFacilitiesManagement#Maximo