Maximo

Maximo

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

 View Only
Expand all | Collapse all

Maximo Mobile SRMOBILE app: Create SR form>Unable to add new fields in the form for customization

  • 1.  Maximo Mobile SRMOBILE app: Create SR form>Unable to add new fields in the form for customization

    Posted Mon February 26, 2024 11:12 AM
      |   view attached

    Hello All,

    I am trying to customize the New SR page of Maximo Mobile SRMOBILE App and observed the OOB values like Details, contact person, Asset,location etc., are formatted using sr-attributes-list.xml. 

    I am trying to add few custom fields on the same lines as OOB but couldn't achieve as the OOB fields are fetched using json datasources with src="{[]}".

    I couldn't find the src for the data sources SRListDetailsDS, SRListContactDS and some other similar datasources used on Create SR form.

    I am also unable to modify the labels for these fields .For Ex: Instead of Contact person I want to display Affected person.

    Any pointers would be really helpful here.
    Thanks

     



    ------------------------------
    Meghana Siriveli
    ------------------------------


  • 2.  RE: Maximo Mobile SRMOBILE app: Create SR form>Unable to add new fields in the form for customization

    Posted Thu February 29, 2024 07:02 AM

    Hi Meghana,

    You will have to modify createSRcontroller.js and app.xml in SRMOBILE file for createsr page modification.



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



  • 3.  RE: Maximo Mobile SRMOBILE app: Create SR form>Unable to add new fields in the form for customization

    Posted Fri March 08, 2024 02:14 AM

    Hi Ritesh and Megan, 

    I am using MAF-tools (local docker image) to add extra customer field. Modifying the createSRcontroller.js is not necessarily required. But to visualize a new customer or standard attribute be aware that you need to add this new attribute as well in the datasource section that is related to this field attribute.  In some case a new state action might be required as well. Notice that the attribute you want to add is not excluded in the related object structure.



    ------------------------------
    Jan-Willem Steur
    Manager Business Development
    ZNAPZ b.v.
    Breda
    +31 6 25639950
    Jan-Willem
    ------------------------------



  • 4.  RE: Maximo Mobile SRMOBILE app: Create SR form>Unable to add new fields in the form for customization

    Posted Fri March 08, 2024 02:34 AM

    Hi Jan,

    CreateSR page is different compared to other pages. It is using split-view template approach.

    So, if we need to add a new attribute in the same approach, will have to modify controller file of createSR.

    And I agree with your point on defining the attribute under object-structure. That is that starting point for any new attribute in Mobile.

    I don't completely understand yet split-view logic, but yes controller modification would be required (as per my understanding).

    If any other way, please advise.

    Thanks in Advance.



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



  • 5.  RE: Maximo Mobile SRMOBILE app: Create SR form>Unable to add new fields in the form for customization

    Posted Fri March 08, 2024 04:39 AM

    Hi Ritesh, Megan,

    Ritesh, you are right. The split-view logic is somewhere stored in a related .js source file. I found however a kind of work-around to add additional data in the right Split View, when opening the details for the contact person. In this detailed view it is possible to extend with additional SR data. As an example I did the trick by adding some extra xml additions and see the result below:

    Code Change


    ------------------------------
    Jan-Willem Steur
    Manager Business Development
    ZNAPZ b.v.
    Breda
    +31 6 25639950
    Jan-Willem
    ------------------------------



  • 6.  RE: Maximo Mobile SRMOBILE app: Create SR form>Unable to add new fields in the form for customization

    Posted Fri March 08, 2024 04:44 AM

    Meghana, Ritesh,

    Afterburner:  the submitted Sr with the affected used is successfully saved and visible in the Service Requests Desktop application:

    SR Desktop


    ------------------------------
    Jan-Willem Steur
    Manager Business Development
    ZNAPZ b.v.
    Breda
    +31 6 25639950
    Jan-Willem
    ------------------------------



  • 7.  RE: Maximo Mobile SRMOBILE app: Create SR form>Unable to add new fields in the form for customization

    Posted Fri March 08, 2024 04:54 AM

    Hi Jan,

    Thank you for the insight.

    In your case, you tested with Affected person, so one can add those extra fields under CONTACT PERSON split view.

    But let's say we have a custom attribute as in "worktype", then it won't fit in any of the available option on left hand side of split view.

    In the end, will have to add the new attribute on left hand side and then split view should work for this as other fields.

    So, in my case, I had to do modification in related JS files and this part is tedious.

    I feel that IBM here should provide a more flexible way to modify the split view instead of controlling via JS files.



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



  • 8.  RE: Maximo Mobile SRMOBILE app: Create SR form>Unable to add new fields in the form for customization

    Posted Fri March 08, 2024 05:41 AM

    Hello Jan and Ritesh,

    Thanks for your responses.

    Yes, I second Ritesh here.

    I wanted to configure additional fields on the left-hand side of the split view template, and it is not straight forward because sr-attributes-list.xml is used to render the UI part of the fields and their respective split view columns.

    @Ritesh, could you please share an overview of how you have manipulated the indexes of split view column using js code for your custom configured fields.



    ------------------------------
    Meghana Siriveli
    ------------------------------



  • 9.  RE: Maximo Mobile SRMOBILE app: Create SR form>Unable to add new fields in the form for customization

    Posted Fri March 08, 2024 05:54 AM
    Edited by Jan-Willem Steur Fri March 08, 2024 05:57 AM

    Megana,

    I can imagine what you want. As I can see now is that the left handed Split View contains "placeholders" that are referring to a kind of lookup to what you see in the right Split View The details belonging to the corresponding placeholder).. That means that if you want to see more "detailed" information (e.g. work type, site of what ever"), the "default IBM design approach" is to add these extra fields in the right Split View. It doesn't make sense to add a left sided attribute with an associated lookup that is filled in in the left Split View, since that is not the common objective / functionality of a Split View. A Split View is used to open te details from the left placed "placeholder" The displayed titles like description, details, contact person are nothing more than placeholder to open the details in the right split view. I had an internal chat with the IBM Design team about this topic and this is how it is designed.

    That doesn't mean that it is not possible to add attribute is the left area of the Split View, but then the left sided extra attributes need to be configured outside the Split View.

    I am working out some variants how this this could be configured  Both outside the Split View or in the Split View as an addition on the left handed placeholders.

    To be continued ...

    Cheers and have fun!



    ------------------------------
    Jan-Willem Steur
    Manager Business Development
    ZNAPZ b.v.
    Breda
    +31 6 25639950
    Jan-Willem
    ------------------------------



  • 10.  RE: Maximo Mobile SRMOBILE app: Create SR form>Unable to add new fields in the form for customization

    Posted Fri March 08, 2024 06:30 AM

    Hi Jan,

    Theoretically for outside of the splitview on the same create workorder page, One can try by adding a new box element at the end of the split view template. 

    And inside box, one can manipulate to display different kind of smart inputs like other pages.

    I haven't tested this approach but hoping that it should work.



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



  • 11.  RE: Maximo Mobile SRMOBILE app: Create SR form>Unable to add new fields in the form for customization

    Posted Fri March 08, 2024 06:40 AM

    Hi Meghana,

    For each field on the left side of splitview, index number is assigned. You should find that index number either in app.xml or related JS file.

    Please follow that.

    And when you add a new field on left hand side, then you have to assign the index number for that.

    Please do remember to adjust the index number for existing fields if you are adding the new field in between of existing fields.

    e.g.  Contact - 1, location - 2, asset -3 (field-index)

    Now you are adding new attribute worktype between contact and location, then index will become like this.

    Contact - 1, worktype - 2, location - 3, asset -4

    Hope this helps.

    P.S. I was able to make it work and data are getting saved in maximo database. But for me, this part was not working - After selecting the value on right hand side, left hand side was not showing the selected value, like it shows in existing fields.

     
    If you are able to make it work, please share that.



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



  • 12.  RE: Maximo Mobile SRMOBILE app: Create SR form>Unable to add new fields in the form for customization

    Posted Fri March 08, 2024 06:51 AM

    Thanks Ritesh,

    I am also trying to achieve the same. Will try this.



    ------------------------------
    Ritu John
    ------------------------------



  • 13.  RE: Maximo Mobile SRMOBILE app: Create SR form>Unable to add new fields in the form for customization

    Posted Mon March 11, 2024 07:54 AM

    Hello Ritesh,

    Thanks for your inputs on the split view indexes.

    Regarding the issue where left-hand side was not showing the selected value, I was able to display the selected value from right hand column to left hand column. Can you share how you are passing the event's value for the field when a lookup value is selected.

    I have used a chevron to open the lookup using a JS method and then the event's value is passed with a diff JS method which is referenced on the lookup definition.

    dsCreateSr.item.<attributename>= event.value; 

    If you are following the same process and still not able to display the value, can you try adding the attribute in srDetailResource datasource also not only in dscreatesr datasource.

    Thanks



    ------------------------------
    Meghana Siriveli
    ------------------------------



  • 14.  RE: Maximo Mobile SRMOBILE app: Create SR form>Unable to add new fields in the form for customization

    Posted Wed March 13, 2024 10:06 AM

    Hi Meghana,

    Glad to know that the suggestions worked.

    For me, I don't think I have written any JS code for lookup selection for the right hand column.

    Out of the box, Since lookup allows to define which attribute to select in app.xml, so did not write anything in JS.

    Snapshot Before Selecting lookup value:

    Snapshot after selecting lookup value:

    Could you share what two codes you written for lookup in JS?



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