Maximo Open Forum

 View Only

 Making a Field Required in Technician - Create Follow-up Work Order

  • Everything Maximo
  • Mobility
Sourabh Jain's profile image
Sourabh Jain posted 02-08-2023 06:27
Hi all,

I need to make the Description field required in the /woedit page in the TECHMOBILE app. I simply added the property as required =“true” which showed the blue dot over the field and made it required. But, I can still save the record with Description value as null. In /editwo page, this field is coming from JSON data source.

When I did the same thing with the WOPRIORITY field then if I clear the value, Save button gets disabled. I am expecting something similar to work for my Description field as well.

Any suggestions please. Thanks.
Sourabh Jain's profile image
Sourabh Jain

Fixed!!!

I have managed to implement it in another way. As I the required="true" didn't work as I wanted, I wrote the code in WorkOrderEditController.js file.

To make the Description field required in my Create Follow-up WO page,:

1) I added the following code in the validateFields() function in WorkOrderEditController.js file.

if ((this.uiRequired("description", workorder.description)))
    {
      arrayListFieldsWithError.push({"attributename":"description", "error":true});
    } else {
      arrayListFieldsWithError.push({"attributename":"description", "error":false});
    }

2) Added the below 2 properties in my smart-input XML tag for Description:

on-blur="validateFields" required = "true"

With this, Save button gets disabled when Description value is empty.

Code can be written in AppCustomizations.js as well, but need to see how does that work.

Thanks.