Thanks for the response.
I would prefer the 1st approach but need to figure it out how to add those in the workordercreatecontroller.js file.
I went through the JS file, but yet to figure it out where to put that.
If any idea, please let me know.
Thanks in Advance.
Original Message:
Sent: Wed March 06, 2024 04:16 PM
From: Vincent Wanders
Subject: Mobile 8.10 App - Create workorder page - Added persongroup unput field but as alias "workgroup" - persongroup not getting saved in workorder
I see two possible solutions.
The first is on the Mobile site. Could be something like this:

Did not test the above one.
The second one I did test and is working for me.
Are you familiar with OSIN automation script?
That are scripts which are run when there is a Rest API post call.
The idea is to fetch the WORKGROUP field from the WORKORDER MBO part when the Post is done.
And then put the value of WORKGROUP into PERSONGROUP just before the data is added to the MBO.
This is done in what you call core Maximo.
Just create a script called OSIN.MXAPIWODETAIL (just the script, no launchpoints)

Put in the text:
def beforeMboData(ctx):
if (ctx.getProcessTable()=="WORKORDER"):
WorkGroup = ctx.getData().getCurrentData("WORKGROUP")
struc = ctx.getData()
struc.setCurrentData('PERSONGROUP',WorkGroup)
#----------------------------------------------------------------------------------------
And press Save.
Then go to the mobile app and create a new workorder in TechMobile
Fill in the info you need, save the record and check Maximo.
Please note that every time a Rest API Post call is done this script is fired.
Maybe you should put an extra check in on being the PERSONGROUP not filled.
In the example above the PERSONGROUP is always overwritten.
------------------------------
Vincent Wanders
Original Message:
Sent: Wed March 06, 2024 06:23 AM
From: Ritesh Ranjan
Subject: Mobile 8.10 App - Create workorder page - Added persongroup unput field but as alias "workgroup" - persongroup not getting saved in workorder
Hi Vincent,
Client is using PERSONGROUP (labeled as "workgroup") attribute in core Maximo, so added that attribute in descreatewo datasource.
<attribute name="persongroup--workgroup" id="1234"/>
Now in app.xml, used "dscreatewo.item.workgroup" to display the input field in create workorder page. It is a required field as in "required="true".
While creating workorder in mobile app, it is not saving the data for "PERSONGROUP" in core maximo.
I checked in developer tools. In post payload, it is sending the data under WORKGROUP attribute which does not exist in workorder object in core Maximo.
If I use "persongroup" attribute directly without an alias, then it works fine. but in this way, the error message is shown in red as below but persongroup word is there.
That is OOTB.

So in order to show "workgroup is required", I used alias in attribute definition.
I hope this clarifies.
Since label is workgroup, the message I need to show as "workgroup" is required.
So how to handle this situation? Please advise.
------------------------------
Ritesh Ranjan
Original Message:
Sent: Tue March 05, 2024 03:40 PM
From: Vincent Wanders
Subject: Mobile 8.10 App - Create workorder page - Added persongroup unput field but as alias "workgroup" - persongroup not getting saved in workorder
I am trying to understand.
Shouldn't the attribute be ownergroup instead of persongroup?
It is on the MXAPIWODETAIL that you are working on?
So something like:
<attribute name="ownergroup" id="bazzline_vw_vcar6"/>
Or add both as attribute and put dscreatewo.item.ownergroup = workgroup
Just my first thoughts.
------------------------------
Vincent Wanders
Original Message:
Sent: Tue March 05, 2024 11:48 AM
From: Ritesh Ranjan
Subject: Mobile 8.10 App - Create workorder page - Added persongroup unput field but as alias "workgroup" - persongroup not getting saved in workorder
HI All,
can someone help on this?
------------------------------
Ritesh Ranjan
Original Message:
Sent: Tue March 05, 2024 05:02 AM
From: Ritesh Ranjan
Subject: Mobile 8.10 App - Create workorder page - Added persongroup unput field but as alias "workgroup" - persongroup not getting saved in workorder
Hi All,
Please guide on below.
Below steps have been taken.
- In Create workorder page, added persongroup attribute in dscreatewo datasource.
- added lookup to persongroup input.
- Added persongroup field in create workorder page for display and tagged the lookup.
- Made field as mandatory (required="true")
- Published the changes.
Able to see the data in persongroup lookup and upon creating the workorder, persongroup input data is getting capture in workorder. (verified in core maximo).
Also, if persongroup data is not filled in createworkorder page, it will show "persongroup is required" message in red below the input field.
Now client use the label as "WORK GROUP" instead of "Persongroup" in core Maximo, so now I did below change in createworkorder page in TECHMOBILE.
- Added alias workgroup in dscreatewo datasource for persongroup attribute. (like persongroup--workgroup)
- Used this dscreatewo.item.workgroup.
- published the change.
Now after doing the changes, workgroup data is not getting captured in core maximo upon creating the workorder.
Error message also shows that WORKGROUP is required if it is not filled.
I checked in developer tools. In post payload, it is sending data under WORKGROUP attribute.
Is maximo-datasource not intelligent enough to update/post data using attribute Alias?
Do we need to use Alias only for displaying or fetching the data but not for updating the same.?
Please advise how to fix this?
Thanks in Advance.
------------------------------
Ritesh Ranjan
------------------------------