Hi Steven,
Thanks for your reply.
I tried defaulting the worktype on the datasource level for new WO, dscreateWO and it worked for new workorders
<attribute default-value="CM" id="y6nm_" name="worktype"/>
Same thing when we try for followup workorders using
dsWoedit, It doesnt work.
Any suggestions for defaulting worktype value on the UI for followup page?
Thanks,
Chinmaya Kore.
------------------------------
CHINMAYA KORE
WIPRO
------------------------------
Original Message:
Sent: 04-24-2024 09:36
From: Steven Shull
Subject: Defaulting a value on the UI for Worktype and targstartdate maximo mobile
worktype is a bit more complicated... the prepareDefaultData method in the WorkOrderCreateController has some logic to set the default based on database defaults or clear the value for the attributes we setup out of the box. This causes your default to get cleared since that logic fires after.
For targstartdate, that is an attribute we do not have out of the box so we would not try to clear the default. I would personally use this:
this.app.dataFormatter.currentDate();
This ensures the data is provided in the format we need based on various settings.
------------------------------
Steven Shull
IBM
Original Message:
Sent: 04-24-2024 08:57
From: CHINMAYA KORE
Subject: Defaulting a value on the UI for Worktype and targstartdate maximo mobile
Hi Team,
Is there a way we can default a value on the UI for worktype and targstartdate on a new and followup workorder for maximo mobile through MAF?
Added below code for new WO,but doesn't seem to work for worktype and targstartdate ,works for persongroup though.
onAddNewRecord({datasource, item}) {
if (datasource && datasource.name === "dsCreateWo")
item.worktype = "CM"
item.persongroup="MAINT"
item.targstartdate= new Date()
console.log('Exiting AppCustomizations.onAddNewRecord');
}
Thanks,
Chinmaya Kore.
#Customizations
#EverythingMaximo
------------------------------
CHINMAYA KORE
WIPRO
------------------------------