I added all fields, which in DB by default doens't has NULL value. Then I commented out fields, which scipt execution told, that are some key fileds, which system only should change, at the end, I got again that message, that something is still missing. I'm afraid, that my code is not correct
aktSet = mbo.getMboSet("ASSET_ASSET")
aktSet.reset()
jAkt = aktSet.add()
jAkt.setValue("DESCRIPTION","Jauns pases aktīvs")
jAkt.setValue("ASSETTYPE","RAA")
jAkt.setValue("PARENT","100000237366")
jAkt.setValue("LOCATION","10000062")
jAkt.setValue("ORGID","ASTORG")
jAkt.setValue("DISABLED","0")
jAkt.setValue("ISLINEAR","0")
jAkt.setValue("ISRUNNING","1")
jAkt.setValue("MXASTYPE","RAA")
jAkt.setValue("ITEMSETID","ASIS")
jAkt.setValue("PURCHASEPRICE","0")
jAkt.setValue("REPLACECOST","0")
#jAkt.setValue("TOTALCOST","0")
#jAkt.setValue("YTDCOST","0")
jAkt.setValue("BUDGETCOST","0")
#jAkt.setValue("UNCHARGEDCOST","0")
#jAkt.setValue("TOTUNCHARGEDCOST","0")
#jAkt.setValue("TOTDOWNTIME","0")
#jAkt.setValue("INVCOST","0")
jAkt.setValue("DISABLED","0")
jAkt.setValue("AUTOWOGEN","0")
#jAkt.setValue("MAINTHIERCHY","0")
jAkt.setValue("MOVED","0")
jAkt.setValue("HASLD","0")
jAkt.setValue("ISLINEAR","0")
jAkt.setValue("RETURNEDTOVENDOR","0")
jAkt.setValue("EXPECTEDLIFE","0")
jAkt.setValue("TLOAMPARTITION","0")
jAkt.setValue("PLUSCISCONTAM","0")
jAkt.setValue("PLUSCISINHOUSECAL","0")
jAkt.setValue("PLUSCISMTE","0")
jAkt.setValue("PLUSCPMEXTDATE","0")
jAkt.setValue("PLUSCSOLUTION","0")
jAkt.setValue("ISCALIBRATION","0")
jAkt.setValue("PLUSDPRIMARYIND","0")
jAkt.setValue("PLUSDHAVESAMPLEWO","0")
jAkt.setValue("PLUSDNEEDSAMPLEWO","0")
jAkt.setValue("MXASISVIRTUAL","0")
jAkt.setValue("PLUSSISGIS","0")
aktSet.save()
aktSet.clear()
aktSet.close()
------------------------------
Juris Flugins
------------------------------
Original Message:
Sent: Mon October 17, 2022 10:33 AM
From: Prashant Sharma
Subject: Creating new asset with script
Hello Juris - You are missing many required fields for example- SITEID in the script.
Kindly make sure you are setting value in all required fields before saving the MboSet.
Thanks.
------------------------------
Prashant Sharma
Maximo Solution Architect
Original Message:
Sent: Mon October 17, 2022 04:37 AM
From: Juris Flugins
Subject: Creating new asset with script
Hello!
I need to create child assets (some 5 with these same descriptions in each case) for asset with specific Description (whenever it is created under some existing assets)
Core script without some specific checking (f.i. if particular childes are already present) looks like this
aktSet = mbo.getMboSet("ASSET_ASSET")aktSet.reset()jAkt = aktSet.add()jAkt.setValue("DESCRIPTION","Jauns pases aktīvs")jAkt.setValue("ASSETTYPE","RAA")jAkt.setValue("PARENT","100000237366")jAkt.setValue("LOCATION","10000062")aktSet.save()aktSet.celar()aktSet.close()
I have all mandatory fields, but is showing error message
BMXAA4195E - A value is required for the Asset field on the ASSET object.
Don't understand, what is really missing, which field?
Thank You!
------------------------------
Juris Flugins
------------------------------
#AssetandFacilitiesManagement
#MaximoIntegrationandScripting
#Maximo