Maximo

 View Only

 Modify IRMOBILE

Jump to  Best Answer
Stacy Yeater's profile image
Stacy Yeater posted 01/09/25 11:27 AM

I need some help. I am trying to add a date field to the Inventory Receiving Maximo Mobile Receive page in MAS8. I am able to enter data into the field and save, but it is not getting pushed back to Maximo. I can see that the request headers contains the field name but the request payload does not. I have added the field to the MXRECEIPT object and included the field in the MXAPIRECEIPT object structure. The datasource mobileReceipts has been updated to include the field. I'm stuck on how to update the payload to include the new field. Is this possible?

I do have the new field in the datasource receivejsonDS as well.

Bartosz Marchewka's profile image
Bartosz Marchewka IBM Champion  Best Answer

Hi Stacy,

I was wrong, it's not enough to make things working. I reviewed ReceivePageController:saveRecevie method (IRMOBILE/src/ReceivePageController.js). It looks like additional customisation is needed in this method PostRequestUtil:setRealValues2AddedNewDSRec (IRMOBILE/src/utils/PostRequestUtil.js). Please try to put your attribute into the constant array called properties (see example below).

Please see my test below (test was done using Mobile v9):

  1. TESTBMA as custom attribute was added into the mobileReceipts maximo-datasource definition.
  2. "Properties" constant array was extended in PostRequestUtil:setRealValues2AddedNewDSRec
/**
 * Get response of the post request
 * @param  {selecteditem} selecteditem the selected item with values to be set.
 * @param  {actionname} actionname the name of the action, e.g. RECEIVE, INSPECT
 * @returns {response} JSON object of items list and the boolean emptyquantity
 */
const setRealValues2AddedNewDSRec = (selecteditem, actionname, item, app) => {
  const properties = [
    "ponum",
    "porevisionnum",
    "orgid",
    "siteid",
    "positeid",
    "polinenum",
    "itemnum",
    "itemsetid",
    "conditioncode",
    "linetype",
    "remark",
    "tolot",
    "shelflife",
    "useby",
    "packingslipnum",
    "receiptquantity",
    "inspectionrequired",
    "rotating",
    "actualdate",
    "testbma"
  ];
  (...)
};

3. New custom field was added into the UI (for verification purpose).

Test (review payload):

Bartosz Marchewka's profile image
Bartosz Marchewka IBM Champion

Hi Stacy
I assuming that you are talking about this page in the IRMOBILE application definition?

<page padding="false" id="receivepage" controller="ReceivePageController">
  <header-template title="Receive" hide-breadcrumb="true" icon-name="carbon:close" icon-action="goBack" id="r9mx9">
    <button slot="buttons" label="Save" kind="primary" icon="carbon:checkmark" on-click="saveRecevie" id="meybr"/>
  </header-template>
  <panel id="max84">
  (...)
  </panel>
</page>


If yes could you please double check if you added your new attribute definition also into the json-datasource called receivejsonDS:

<json-datasource id="receivejsonDS" src="{[]}" clear-selection-on-search="false" items="items" schema="schema" auto-save="{false}" id-attribute="polineid">
	<schema id="ka82k">
	  <attribute name="issuetype" id="m6q55"/>
	  <attribute name="ponum" id="jpb8j"/>
	  <attribute name="polineid" unique-id="true" id="pbndv"/>
	  (...)
	</schema>
</json-datasource>

Stacy Yeater's profile image
Stacy Yeater

Thanks for the response. I do have the field in the receivejsonDS as well.

Stacy Yeater's profile image
Stacy Yeater

Thanks. I have been trying to figure out how to update this in 8 and I can not figure out how to update the Post through the appcustomizations.js. Do you know of a way of doing this in Maximo Mobile 8? Everything I have tried seems to be ignored.

Bartosz Marchewka's profile image
Bartosz Marchewka IBM Champion

Hi Stacy,

I checked Maximo Mobile v8 IRMOBILE and source code in the ReceivePageController:saveRecevie method looks almost the same compare to v9. In connection to that I suggest you to try modify PostRequestUtil:setRealValues2AddedNewDSRec (IRMOBILE/src/utils/PostRequestUtil.js) as I described in the post above. I don't know if it's possible to achieve these changes via appcustomizations.js. I know that it's working when you modify PostRequestUtil.js

Stacy Yeater's profile image
Stacy Yeater

I completely misunderstood this the first time I read it. I got it now. This worked perfect! Thanks!