Maximo

 View Only
  • 1.  Maximo Mobile 8.10 - Want to show SAVE/DISCARD message on task page when user clicks on back icon(top left) in order to go back to wo details page

    Posted Thu March 21, 2024 09:10 AM

    Hi All,

    Looking for some guidance with below issue.

    I have added some input fields in task page. I have also custom save button which works fine.

    User can input the data in those fields and then user needs to click on custom save button which in turn save data in core maximo database.

    But if user do not click on save after providing the inputs and click on that back icon to go back to workorder details page, then those input data don't get saved. So looking for way to show the message to the user like we get in create workorder page in mobile if you try to go back without saving the workorder.

    Please help, Thanks. 



    ------------------------------
    Ritesh Ranjan
    ------------------------------


  • 2.  RE: Maximo Mobile 8.10 - Want to show SAVE/DISCARD message on task page when user clicks on back icon(top left) in order to go back to wo details page

    Posted Fri March 22, 2024 01:26 PM

    Can someone advise on this?



    ------------------------------
    Ritesh Ranjan
    ------------------------------



  • 3.  RE: Maximo Mobile 8.10 - Want to show SAVE/DISCARD message on task page when user clicks on back icon(top left) in order to go back to wo details page

    Posted Sat March 23, 2024 02:05 PM

    On your page, have the useConfirmDialog setup as a state variable. When this is true, we should prompt you to save. This will call a traditional save on the datasource (not executing special logic that you might have on your save button). If you need to execute special logic, there is an onCustomSaveTransition function that you can declare in a controller (I don't think it's possible to put in AppCustomizations.js, though I haven't tried) to execute special logic when the save option is picked in the dialog.

    If you're on 8.11 in the config image, this topic is covered on the "Managing data on a page" under Developing with Graphite section of the developer wiki. 



    ------------------------------
    Steven Shull
    ------------------------------



  • 4.  RE: Maximo Mobile 8.10 - Want to show SAVE/DISCARD message on task page when user clicks on back icon(top left) in order to go back to wo details page

    Posted Mon March 25, 2024 02:32 AM

    Hi Steven,

    Thanks for the response.

    Below is the task screen, which has been modified. These are just two Smart-inputs. On top right corner, custom save button was created to save these inputs.

    Now when user modifies one of the inputs and click on back icon (top left) without clicking on custom save button, then this page does not give any prompt.

    For custom save button, have written the logic in AppCustomization.js.

    As per the suggestion, I added the state useconfirmdialog as true in the tasks page.

        <page controller="TaskController" id="tasks">
          <states id="ma9kb">
            <state name="useConfirmDialog" value="true" type="boolean" id="avw9b"/>
          </states>

    Did the preview. I modified one of the input and clicked on back icon, it does not give any prompt for Save/Discard.

    Please advise if I am missing anything.

    Note: I saw 8.11 documentation, but it just says about defining states and nothing else.



    ------------------------------
    Ritesh Ranjan
    ------------------------------



  • 5.  RE: Maximo Mobile 8.10 - Want to show SAVE/DISCARD message on task page when user clicks on back icon(top left) in order to go back to wo details page

    Posted Mon March 25, 2024 08:15 AM

    You need to be careful when using our out of the box pages & controllers when introducing custom functionality. Even though this state variable isn't declared in the app.xml (declaring states in the app.xml isn't actually required but is good from a documentation perspective), we modify it multiple times in the TaskController including any time a value is changed. If the value being modified is not a meter reading, we set this value back to false. You could try and update it again after but there is no guarantee in the order that the JavaScript events will fire. 

    I would recommend doing this on your own page so you can avoid the out of the box controller. 

    The exact link in the developer documentation wiki link in the docker configuration image is below. If you are not familiar with this wiki, clicking the help icon in the top right corner of your docker image and hitting "Developer Documentation" will link you to the wiki. This is part of our internal wiki that we are constantly updating. Since it is shipped in the docker container though, it's only updated as you get the new container images. It is important that you do NOT use the wrong version of the docker config image. If you want to run the latest to look at the documentation, that's fine, but make sure you build with the appropriate version of the config image for your environment. 



    ------------------------------
    Steven Shull
    ------------------------------



  • 6.  RE: Maximo Mobile 8.10 - Want to show SAVE/DISCARD message on task page when user clicks on back icon(top left) in order to go back to wo details page

    Posted Tue May 28, 2024 09:34 AM

    Hi Ritesh,

    I am in a similar position - adding custom fields to tasks page. Did you manage to get discard warning working ? Also, can you please share the code behind the custom save button.

    Thanks,



    ------------------------------
    Amir Anwar
    ------------------------------



  • 7.  RE: Maximo Mobile 8.10 - Want to show SAVE/DISCARD message on task page when user clicks on back icon(top left) in order to go back to wo details page

    Posted Tue May 28, 2024 09:57 AM

    As I mentioned above, I would NOT do this on the out of the box tasks page. You should add your own tasks page or a sliding drawer mechanism for editing. If this was a page where we enabled users to edit fields, then adding new fields wouldn't be a problem. But because we're managing this state variable for our own purposes in this app, you're not going to be able to manage the state variable the way you need. 



    ------------------------------
    Steven Shull
    ------------------------------