Hi Steven,
Please find the code snippet. I am doing this in app.xml.
<smart-input hide-step-buttons="true" id="xyz2v" label="Jobplan Adequate?" readonly="{woDetailsReportWork.item.allwonum !== woDetailsReportWork.item.wonum}" required="!{page.state.isAdequate}" show-verbose="true" value="{reportWorkPageActual.item.jobadequate}"/>
<smart-input id="j3mqa" label="Comments" readonly="{woDetailsReportWork.item.allwonum !== woDetailsReportWork.item.wonum}" value="{reportWorkPageActual.item.jobadqcomm}" required="{reportWorkPageActual.item.jobadequate === false}"/>
Error screenshot is as below

------------------------------
Swagatika Rout
------------------------------
Original Message:
Sent: Wed February 07, 2024 01:56 PM
From: Steven Shull
Subject: Error message is not going away automatically
Are you able to share your exact code snippet throwing the error? Since you're talking about Maximo Mobile and the error not going away, I assume in your AppCustomizations.js you're using the setWarning method on the datasource but aren't clearing it when it has been entered. For example, below is a snippet of how you can set a warning and how you clear it from the field.
if (recordFound)
{
ds.clearWarnings(workorder,attribute);
}else{
ds.setWarning(workorder,attribute,"Comment is required");
}
You would want to call the clearWarning when the comment field is changed and a value exists. You would also want to set the error again if the value becomes null again (since someone could enter a value and then clear it out and you still want it to display an error in that scenario).
------------------------------
Steven Shull
Original Message:
Sent: Wed February 07, 2024 12:52 PM
From: Swagatika Rout
Subject: Error message is not going away automatically
Hi Steven,
Thanks for replying. We are implementing this in Maximo Mobile for EAM - windows desktop App version 8.10 with maxim 7.6.1.3.
------------------------------
Swagatika Rout
Original Message:
Sent: Wed February 07, 2024 11:00 AM
From: Steven Shull
Subject: Error message is not going away automatically
Can you provide some additional clarity on how you've configured this? Is this desktop or mobile? How are you throwing the error?
Generally speaking, in a use case like this where we always want to require a field conditionally, I like to use a global data restriction. I would set it up on the attribute, mark the attribute (in this case comments) as required with a condition, and then depend on the framework to enforce that it's required.
Your condition would look something like below.
:adequate='NO'
When that's true the field would be made required.
------------------------------
Steven Shull
Original Message:
Sent: Wed February 07, 2024 10:40 AM
From: Swagatika Rout
Subject: Error message is not going away automatically
Hi All,
Created two custom fields adequate and comments.when adequate is set as NO, comments to be mandatory and should show error message "Comment is Required" if we leave the comment blank.The error message should go away automatically when adequate set to Yes. But the error message is not going away automatically. Please help on this issue.
Thanks in Advance.
------------------------------
Swagatika Rout
------------------------------