Maximo

 View Only

Maximo Mobile 8.10 - Edit WO by passing the WO Detail View

  • 1.  Maximo Mobile 8.10 - Edit WO by passing the WO Detail View

    Posted Mon May 15, 2023 02:27 AM
    Edited by Maycon Belfort Mon May 15, 2023 02:28 AM

    Hi everyone,

    Any idea how I can open the edit WO screen from the list bypassing the WO Details screen? The idea is to create a new edit button in the wo-card and, when clicking it, open the edit view.

    I'm currently using Maximo Mobile 8.10, and this is what I tried to do, but I'm breaking the page due to internal validations on WorkOrderDataController.

    # on AppCustomizations.js
    
    async myOpenEditPage(event) {
        let workorder = event.item;
        let woDetailsPage = this.app.findPage('workOrderDetails');
        woDetailsPage.runInitializers()
        
        let woDetailResource = woDetailsPage.getDatasource('woDetailResource');
        await woDetailResource.load({
          noCache: true,
          forceSync: true,
          itemUrl: workorder.href,
        });
        let woSchema = woDetailResource.getSchema();
    
        if (workorder && (workorder.wonum || workorder.href)) {
          woDetailsPage.state.woDetail = {
            page: 'workOrderDetails',
            wonum: workorder.wonum,
            siteid: workorder.siteid,
            href: workorder.href,
          };
          this.app.setCurrentPage({
            name: 'woedit',
            resetScroll: true,
            params: { 
              workorder, woSchema ,
              wonum: workorder.wonum,
              istask: workorder.istask,
              wogroup: workorder.wogroup,
              taskid: workorder.taskid
            },
          });
          if (this.app.currentPage) {
            this.app.currentPage.callController('loadRecord', workorder);
          }
          
        }
      }



    Thank you.



    ------------------------------
    Maycon Belfort
    Consultant
    BPD Zenith
    Melbourne
    Australia
    ------------------------------