Maximo Open Forum

 View Only
  • 1.  Defaulting a value on the UI for Worktype and targstartdate maximo mobile

    Posted 11 days ago

    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
    ------------------------------


  • 2.  RE: Defaulting a value on the UI for Worktype and targstartdate maximo mobile

    Posted 11 days ago

    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
    ------------------------------



  • 3.  RE: Defaulting a value on the UI for Worktype and targstartdate maximo mobile

    Posted 10 days ago

    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
    ------------------------------