Maximo

Maximo

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

 View Only
  • 1.  Unable to Update Custom Attribute from Maximo Mobile Using Toggle Control

    Posted Wed April 08, 2026 03:08 PM

    Hello Everyone,
    I have created a custom attribute LEAD(yorn) in the ASSIGNMENT object, and the requirement is to update this attribute from Maximo Mobile.
    Current Behavior

    I attempted to use a Toggle control inside a Sliding Drawer in Maximo Mobile.
    The toggle does not enable/disable on a single tap.
    In RBA (Role‑Based Applications): The toggle works, but it requires a drag action instead of a single click.

     In Maximo Mobile: Dragging the toggle does not work at all.

    I also checked Checkbox, but it appears checkbox is not supported in the current Maximo Mobile version.

    Expected Behavior

    User should be able to update the LEAD attribute easily (single tap) from the mobile UI without complex gestures.

    Here is my code(works in RBA with toggle drag but not in mobile)

    <maximo-datasource offline-immediate-download="true" id="technicianDS" relationship="showassignment" selection-mode="none" depends-on="woDetailResource" notify-when-parent-loads="true" pre-load="true"  cache-expiry-ms="1" >
    <schema id="wez_e">
    <attribute name="assignmentid" id="wwmgx"/>
    <attribute name="laborcode" id="vq976"/>
    <attribute name="person.displayname--displayname" searchable="true" id="g7aqg"/>
    <attribute name="lead" id="byd9x"/>
    </schema>
    </maximo-datasource>
    =============================
    <sliding-drawer id="techniciandrawer" content-padding="false" align="start" header-text="Technicians List">
    <panel id="nny2x">
    <box padding-top="1" id="qnev_"/>
    <data-list datasource="technicianDS" show-search="false" id="y8y59">
    <border-layout padding="false" slot="item" fill-parent="true" id="mpeej">
    <start width="70" horizontal-overflow="hidden" id="k7e__">
    <field value="{item.displayname}" override-required="true" hidden="{!item.displayname}" field-class-name="16-bold" padding="none" hide-label="true" id="k8dmb"/>
    <field value="Lead Tech" override-required="true" hidden="{!item.lead}" field-class-name="16-bold" padding="none" hide-label="true" id="y236b"/>
    </start>
    <end width="30" id="ew9rb">

    <toggle id="leadToggle" label="Lead" toggled="{item.lead}" on-toggle="selectLeadTech" on-toggle-arg="item"/>

    </end>
    </border-layout>
    </data-list>
    </panel>
    </sliding-drawer>
    =============================
    <button icon="carbon:user" id="gyqdn" kind="secondary" dialog="techniciandrawer"/>
    =======================

     

    app Customization.JS
    =====================
    async selectLeadTech(event, item) {

        const toggledValue = !item.lead;

        try {
            const ds = this.app.findDatasource("technicianDS");
            item.lead = toggledValue;
            await ds.save();
            await ds.forceReload();
        } catch (err) {

        }
    }

     

    Questions

     

    Is the Toggle control officially supported for write operations in Maximo Mobile?
    Are there known limitations with Toggle/Sliding Drawer interactions in Maximo Mobile?
    Is there any recommended alternative UI pattern (e.g., button, action, segmented control, conditional action, dialog, etc.) to update a Boolean/custom attribute from Mobile?
    Has anyone successfully implemented a custom yorn field update in Maximo Mobile, and if so, how?

     

    Any guidance, best practices, or examples would be greatly appreciated. Let me know if any additional information is required.
    Thanks in advance!



    ------------------------------
    Swagatika Rout
    ------------------------------


  • 2.  RE: Unable to Update Custom Attribute from Maximo Mobile Using Toggle Control

    Posted Wed April 08, 2026 05:12 PM

    Hi @Swagatika Rout,

    I recommend reviewing the ASSETMOBILE application, as it contains multiple examples of toggle component usage.

    For instance, on the Edit Asset page (id: editasset, controller: AssetEditDataController), there is a section called Linear Asset or Calibration which includes two toggles. I suggest reviewing the Calibration? toggle as a reference example.

    <box direction="row" horizontal-align="center" vertical-align="center" padding-start="0" padding="1.5" fill-parent-horizontal="true" id="pbm7z">
                    <toggle label="Linear asset?" toggled="{dsEditAsset.item.islinear}" left-align-label="true" readonly="{page.state.isCalibration}" hidden="{!page.state.linearLicense}" on-toggle="handleLinearToggleEdit" id="n3nmw"/>
                    <toggle label="Calibration?" toggled="{dsEditAsset.item.iscalibration}" left-align-label="true" readonly="{page.state.isLinear}" on-toggle="handleCalibrationToggle" id="zzvag"/>
    </box>
    
    File: src/AssetEditDataController Method: handleCalibrationToggle
    handleCalibrationToggle() {
        let dsEditAsset = this.app.findDatasource("dsEditAsset");
        this.page.state.isCalibration = !this.page.state.isCalibration;
        dsEditAsset.item.iscalibration = this.page.state.isCalibration;
        (...)
     }

    File src/AssetEditDataController Method: updateAsset

    /**
       * Function to update asset.
       */
      async updateAsset(evt) {
        let asset = evt.item;
    
        this.page.state.saveInProgress = true;
        const device = Device.get();
    
        // istanbul ignore else
        if (asset) {
          let assetEditResource = this.app.findDatasource("dsEditAsset");
          assetEditResource.currentItem.siteid = this.app.client.userInfo.insertSite;
          assetEditResource.currentItem.islinear = this.page.state.isLinear;
          assetEditResource.currentItem.iscalibration = this.page.state.isCalibration;
    
          if(!this.page.state.isConditionCodeEnable) {
            assetEditResource.updateRequired('conditioncode', false, assetEditResource.item, false);
          }
    
          try {
            /* istanbul ignore else */
            if (!assetEditResource.currentItem.islinear) {
              // clear linear fields
              assetEditResource.currentItem.direction = "";
              assetEditResource.currentItem.lrm = "";
              assetEditResource.currentItem.startmeasure = "";
              assetEditResource.currentItem.endmeasure = "";
              assetEditResource.currentItem.startdescription = "";
              assetEditResource.currentItem.enddescription = "";
              this.clearWarnings("lrm");
              this.clearWarnings("startmeasure");
              this.clearWarnings("endmeasure");
            }
            // istanbul ignore else
            if (this.callDefaultSave) {
              this.page.state.useConfirmDialog = false;
            }
    
            let response;
            this.saveDataSuccessful = true;
            assetEditResource.on("save-data-failed", this.onSaveDataFailed);
    
            if (this.checkAssetMoveAllowed(assetEditResource.currentItem)) {
              let moveResponse = await this.moveAsset(assetEditResource.currentItem);
              // istanbul ignore next
              if (moveResponse) {
                this.displayWarningPopup(moveResponse);
              }
            }
    
            if (this.page.state.classificationChanged) {
              await this.updateSpecification(assetEditResource.currentItem);
              this.page.state.classificationChanged = false;
              this.clearTempEditDS();
            }
    
            /* istanbul ignore else */
            if (!this.page.state.parentUpdatedFailed) {
              let interactive = { interactive: !this.page.state.isMobile };
              response = await assetEditResource.save(interactive);
              this.page.state.saveInProgress = false;
    
              /* istanbul ignore next */
              if (response && assetEditResource.currentItem) {
                let assetnum = assetEditResource.currentItem.assetnum;
                let itemhref = assetEditResource.currentItem.href;
                if (device.isMaximoMobile) {
                  this.app.pageStack.pop();
                  this.app.setCurrentPage({
                    name: "assetDetails",
                    resetScroll: true,
                    params: { assetnum: assetnum, href: itemhref },
                  });
                } else {
                  /* istanbul ignore next */
                  if (response.items && response.items.length > 0) {
                    this.app.pageStack.pop();
                    if (response.items[0].href) {
                      this.app.setCurrentPage({
                        name: "assetDetails",
                        resetScroll: true,
                        params: {
                          assetnum: assetnum,
                          href: response.items[0].href
                        },
                      });
                    }
                  }
                }
              }
            }
    
          } catch (error) {
            /* istanbul ignore next */
            log.t(TAG, error);
          } finally {
            this.page.state.saveInProgress = false;
            /* istanbul ignore else */
            if (this.callDefaultSave) {
              this.page.state.useConfirmDialog = true;
            }
            assetEditResource.off("save-data-failed", this.onSaveDataFailed);
          }
        }
      }

    To better understand why the update is not working, I suggest raising an IBM Case requesting IBM to share the Android debug build of the MAS Mobile application. This would allow you to connect to your environment and use Chrome DevTools to inspect the console and network logs.

    The root cause may be related to the HREF value - since your datasource definition depends on woDetailResource, the object you are trying to update sits at the "second level" of the data hierarchy.



    ------------------------------
    Bartosz Marchewka
    IBM Maximo Consultant
    AFRY
    ------------------------------



  • 3.  RE: Unable to Update Custom Attribute from Maximo Mobile Using Toggle Control

    Posted Thu April 09, 2026 09:20 AM

    Hi @Bartosz Marchewka

    Thank you for the detailed explanation and reference to ASSETMOBILE - that was helpful.
    I wanted to clarify a bit more about my use case and current behavior:
    - The toggle itself is working as expected when used inside standard sections (similar to the Linear / Calibration example you shared). The state updates correctly and the value is saved without issues there.
    - I'm also able to update the same value from a role-based application - the toggle works via click+drag in that context as well.

    However, my requirement is slightly different:
    I need to place the toggle inside a side sliding drawer and within a <data-list>, because:
    There can be multiple technicians added in the Assignment list.
    Each technician row needs its own toggle-driven attribute update.

    Issue Observed
    In the MAS Mobile application, when the toggle is placed inside a <data-list> (row-level) or sliding drawer, the click / drag interaction does not respond.
    The same UI definition behaves correctly (using click + drag) in the role-based (web) application, which makes this appear mobile-specific.

    This leads me to a few questions:
    Is this a known or expected behavior of <toggle> components when used inside a <data-list> on MAS Mobile?
    Are there any shipped examples where:
    A toggle is used inside a data-list row, or toggle is used inside a sliding drawer?
    If this is a known limitation for mobile, what alternative patterns are recommended for this Maximo / MAS Mobile version?

    Before raising an IBM Case, I wanted to check whether this interaction limitation is already documented or by design for MAS Mobile, especially considering touch interactions, gesture handling, and nested components like data-list rows.

    Appreciate any guidance or examples you can share.

    Thanks,

    Swagatika
     



    ------------------------------
    Swagatika Rout
    ------------------------------



  • 4.  RE: Unable to Update Custom Attribute from Maximo Mobile Using Toggle Control

    Posted Fri April 10, 2026 01:38 PM

    Hi @Swagatika Rout

    Thanks for the additional information. In my opinion, this is not a limitation but a bug in the framework, and it should definitely be reported to IBM.

    I recall a similar situation where checkboxes and toggles weren't working properly for the attachment-list component. IBM was informed at the time, but only through email and I didn't follow up to confirm whether it was eventually fixed.



    ------------------------------
    Bartosz Marchewka
    IBM Maximo Consultant
    AFRY
    ------------------------------



  • 5.  RE: Unable to Update Custom Attribute from Maximo Mobile Using Toggle Control

    Posted Sun April 12, 2026 07:21 PM

    Hi @Swagatika Rout

    You can do something similar to the OOTB item.progress attribute (also a YORN field) of Work Order's Multi Asset Loc CI list of records.

    Regards

    Govind.



    ------------------------------
    Govindlal Jaiswal
    ------------------------------