Maximo

Maximo

Come for answers, stay for best practices. All we're missing is you.

 View Only

Maximo Mobile Create Workorder using Asset's siteid instead of user default site id

By Piyush Sukhadiya posted Thu May 22, 2025 12:40 AM

  

This blog will walk you through the process of creating a Workorder using the SiteId of the chosen Asset rather than the user's default SiteId. When loading assets from different sites onto mobile and creating a workorder for an asset that is not under the user's default SiteId, this is useful.

This also includes a helpful example of how to override a controller method when customizing your Maximo Mobile applications.

pageInitialized(page, app) {

    if (["createwo", "woedit"].includes(page.name)) {

      let controller = page.controllers[0];

      const datasourceName = page.name === "createwo" ? "dsCreateWo" : "dsWoedit";

      const orgChooseAssetItem = controller.chooseAssetItem.bind(controller);

      const orgChooseAsset = controller.chooseAsset.bind(controller);

     // When the user types a known asset in the input box
      controller.chooseAssetItem = (item) => {

        orgChooseAssetItem(item);

        app.findDatasource(datasourceName).item.siteid = item.siteid;

      };


      // When the user selects an asset from the lookup
      controller.chooseAsset = (item) => {

        orgChooseAsset(item);

        app.findDatasource(datasourceName).item.siteid = item.siteid;

      };

    }

  }

#MaximoMobile #Technician #MobileCustomization #CreateWorkorder #Mobile #WorkExecution

0 comments
10 views

Permalink