Maximo Open Forum

 Prevent child assets from following the parent asset when it is moved to another location using the action MOVE/MODIFIER ASSETS in ASSET APPLICATION

  • Administration
  • Assets
Maria hnaff's profile image
Maria hnaff posted 12-13-2024 03:44
Hello,
Their is a way to prenvent child asset from following the parent asset when it is moved to another location when i use the Action using the action "MOVE/MODIFIER ASSETS" in ASSET APPLICATION to move the asset or modify the parent asset , so the location of asset childrens will be also modified so i want to prevent this action.
 
i use a script auto Before Save on the object ASSET :
 
        locMboValue = mbo.getMboValue("LOCATION")
        locInitValue = locMboValue.getInitialValue().asString()
        locCurrValue = locMboValue.getCurrentValue().asString()
 
 
        if locInitValue != locCurrValue:
            
            mbo.setValue("LOCATION",locInitValue,MboConstants.NOACCESSCHECK)
 
 
        childSet = mbo.getMboSet("CHILDREN")  
        child = childSet.moveFirst()
        while(child):
            
            childInitValue = child.getMboValue("LOCATION").getInitialValue().asString()
            child.setValue("LOCATION",childInitValue,MboConstants.NOACCESSCHECK)
 
            child = childSet.moveNext()
        childSet.save()    
        childSet.close()
 
 
 
But the script doesn't do anything, the location of assets still changes. maybe the launch point is wrong ? 
 
Can you please help me!
 
Thanks 
Matt F's profile image
Matt F

Hi Maria,

My initial tests of my script did show it working here, but not currently. I'll have to retrace my steps and update again when I can.

# TO BE UPDATED


Cheers,

Maria hnaff's profile image
Maria hnaff

Hi Matt,

Thank you for your response, i test your code but the childrens of the asset are being moved.

Thanks.