Hi Chinmaya,
I thought you were trying some custom code. If you're trying to modify the OOTB behaviour, you probably will need to do more.
In the TECHMOBILE/src/WorkOrderEditController.js source code, there is a createFollowupWo function, which you can read and try to understand how the FUP work order is being created. That being said, you can try to catch the event on-before-save on your AppCustomizations.js using the functions onBeforeSaveData and onBeforeUpdateData (not sure if this one exists. If not, you can add an event listener on your pageResumed).
The onBeforeSaveData will be used to catch the save event on newWods, and you will need to remove the origrecordid, origrecordclass, and origwoid fields. Those are the fields that create the FOLLOWUP type in Maximo.
The onBeforeUpdateData will be used to change the relation type on the woDetailRelatedWorkOrder datasource.
I wrote a blog explaining how those events work in Mobile. You can read it to understand better what you need to do. https://www.bpdzenith.com/the-bpd-blog/maximo-mobile-event-emitter
Cheers.
------------------------------
Maycon Belfort
Consultant
BPD Zenith
Melbourne
Australia
------------------------------
Original Message:
Sent: Mon November 20, 2023 03:04 PM
From: Chinmaya Kore
Subject: Create related records maximo mobile
Thanks Maycon for your reply. I tried using the dsWoedit datasource to set the value,But I wasnt able to set it. Am I using the correct data source?
------------------------------
Chinmaya Kore
Original Message:
Sent: Thu November 16, 2023 01:37 AM
From: Maycon Belfort
Subject: Create related records maximo mobile
I haven't tested it but you can try this. I'm assuming the datasource is the related record one.
onBeforeAddData({datasource, item, options}) { if (datasource.name === 'THE DATASOURCE ID') { item.relatetype = 'RELATED' }}
You can learn more about these functions and how to intercept the datasource events here: https://www.bpdzenith.com/the-bpd-blog/maximo-mobile-event-emitter
------------------------------
Maycon Belfort
Consultant
BPD Zenith
Melbourne
Australia
Original Message:
Sent: Wed November 15, 2023 09:59 PM
From: Chinmaya Kore
Subject: Create related records maximo mobile
Is there an an easy way to create Related workorders in maximo mobile (For EAM).When the user clicks on "Create Relate Work"the page should open and the the RELATEDRECORD.RELATETYPE should be set to RELATED.I checked the controller RelatedWoController and understood that the logic is in WorkOrderEditController. Can you please guide on how I should go ahead with this requirement.Below are the UI changes I did.
------------------------------
Chinmaya Kore
------------------------------