Maximo Open Forum

 View Only
Expand all | Collapse all

Maximo Application Framework: Mobile - TECHMOBILE - maximo-datasource

  • 1.  Maximo Application Framework: Mobile - TECHMOBILE - maximo-datasource

    Posted 02-22-2024 12:19

    Working on the TECHMOBILE app, I was wondering if anyone knows how to remove a item from a maximo-datasource that has not been committed to the server. I added the item to the maximo-datasource using addNew. So the item has a valid id and I would like the user to have the ability remove a item before it is committed if they made a mistake.

    Also in general better documentation on the functionality, or in general compared to what IBM had in the MAF Tool. I have been trying to resolve this looking at the functions on the Datasource.js file, to no avail.

    Items are adding using a slider-drawer

    Items are displayed using a data-list, which has a button that sends a event with the item attached. 

    Any help, or resources would be greatly appreciated. 


    #MaximoApplicationSuite

    ------------------------------
    Jonas Fuller
    Serco NA
    ------------------------------


  • 2.  RE: Maximo Application Framework: Mobile - TECHMOBILE - maximo-datasource

    Posted 02-23-2024 10:15

    Update:
    I looked through the Datasource.js file that the maximo-datasource uses before it hits an adapter js file. I tried implementing a few of the functions to no avail. So I wrote my own function in appCustomizations.js that removes the client side record from the maximo-datasource and does a little bit of clean-up on the other props inside the maximo-datasource. This seems to be working well it is not creating the deleted records in Maximo when the .save() is called. 



    ------------------------------
    Jonas Fuller
    Serco NA
    ------------------------------



  • 3.  RE: Maximo Application Framework: Mobile - TECHMOBILE - maximo-datasource

    Posted 02-26-2024 13:12

    In 8.11, we added the ability to delete items that are a child record of the main transactional record in Maximo Mobile. We do not yet support deleting the main record. For example, you can delete an inventory usage line but not an inventory usage record. The API to do that is to use the deleteItems where you pass in an array of items that you want deleted. This will remove them from the local database & the Maximo server if they already exist there. 

    I'm not sure how exactly you went about your customization but it's important to be aware that JavaScript does not provide the capability to define public/private methods so we can't prevent you from manipulating the datasource in unsupported ways, but it could lead to problems down the road. 



    ------------------------------
    Steven Shull
    IBM
    ------------------------------



  • 4.  RE: Maximo Application Framework: Mobile - TECHMOBILE - maximo-datasource

    Posted 02-26-2024 14:27

    I have a child maximo-datasource the needs to stage records on it. The scenario is I wanted to create a task on the work order and then add services for that task. All in one action they would be created and linked form one page navigation. This means the services need to sit on the client side till the save occurs on the newly created task is made so that I do not get a "___ is not a valid task". That is why I was asking if there is method for deleting client side records. Thanks for the info Steven Shull. Is there any plans to add a method in the datasource.js to remove items from a unsaved maximo-datasource, and or json-datasource?



    ------------------------------
    Jonas Fuller
    Serco NA
    ------------------------------



  • 5.  RE: Maximo Application Framework: Mobile - TECHMOBILE - maximo-datasource

    Posted 04-25-2024 08:16

    Hi Team , i would like to hide few statuses in maximo mobile for example for dispatch statuses i should be able to see only few statuss similarly for other status inprg also only few statsues should be visible , 



    ------------------------------
    uttam ibbandi
    ibm
    ------------------------------



  • 6.  RE: Maximo Application Framework: Mobile - TECHMOBILE - maximo-datasource

    Posted 04-25-2024 13:35

    The values that are feed into the status change window come from this Object Structure MXAPISYNONYMDOMAIN, with the MOBILEDOMAIN Saved query. This query uses the WOSTATUS Domain for it's data, and will return what you see in that list. They created so the Maximo manage and mobile use the same status domain.



    ------------------------------
    Jonas Fuller
    Serco NA
    ------------------------------



  • 7.  RE: Maximo Application Framework: Mobile - TECHMOBILE - maximo-datasource

    Posted 14 days ago

    Hi Jonas, thanks for your reply, we want to do validation for worklog, problem, code and remedy , show some warning message when we are changing the status to Completed , do you have any snippet code to have some validations before completing the workorder, if so where or in which class we need to write the validations



    ------------------------------
    uttam ibbandi
    ibm
    ------------------------------



  • 8.  RE: Maximo Application Framework: Mobile - TECHMOBILE - maximo-datasource

    Posted 14 days ago

    Hi Jonas, 

    I have a requirement to declare some methods or variables in appcustomizations and use those methods in changestatuscontrolles.js file. Any help would be appreciated



    ------------------------------
    uttam ibbandi
    ibm
    ------------------------------



  • 9.  RE: Maximo Application Framework: Mobile - TECHMOBILE - maximo-datasource

    Posted 7 days ago

    Currently I am hitting a roadblock with the tools that I need to edit the "hidden" js files that are not accessible through the tools. If you know the function name then you should be able to route the action to the appcustomizations.js and then have validation before you pass it back the original controller file. (changestatuscontrolles.js)



    ------------------------------
    Jonas Fuller
    Serco NA
    ------------------------------



  • 10.  RE: Maximo Application Framework: Mobile - TECHMOBILE - maximo-datasource

    Posted 14 days ago

    HI Steve, i have a requirement to declare some variables or methods in appcustomizations .js and then use those methods or variables in changestatus controller class file. 

    Any help would be much appreciated



    ------------------------------
    uttam ibbandi
    ibm
    ------------------------------



  • 11.  RE: Maximo Application Framework: Mobile - TECHMOBILE - maximo-datasource

    Posted 7 days ago

    The appcustomizations.js file is ran last in the stack, if you add a function to that file and call it from the app.xml it will execute. So in one component in the app.xml add the function that you want to fire,  to the parameter that is called. Example like when the button is clicked, or another event is fired. You can pass parameters as well through a lot of the components to the appcustomizations.js file as well.



    ------------------------------
    Jonas Fuller
    Serco NA
    ------------------------------