Hide Info message " Requested item is approved".

Phanideepthi
Tera Contributor

Hi All,

We are facing a issue with the approve button. So lets say when the state of RITM is pending we should not allow the approvers to approve the RITM, Until or unless they make the state back to open .

I have a BR rule which is restricting the user to approve and all are working fine. But the problem is I am also getting a Info message saying " the requested item is approved". Even if we are not allowing to approve.

Tried gs.FlushMessage and clearmessage but non of them seems working.

Anyone help me to hide the info message.

Thanks

7 REPLIES 7

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

did you check which BR is showing that info message?

it seems your RITM is getting approved although you are trying to restrict it

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

patricklatella
Mega Sage

Hi all, I'm facing the same issue.

It appears to me that the "ApprovalUserFeedback" script include is what is generating that info message...and this script include says "This item is read-only based on its protection policy."

My business rule is correctly blocking the approval under my configured conditions, however the script include is still showing the "Approved Requested Item: XXXXXXXX" info message.

I have tried adding gs.flushMessages(); to my business rule, however this is not hiding the info message.

Any luck on figuring this out?  Thanks in advance.

patricklatella
Mega Sage

I figured out a solution for this.  The "ApprovalUserFeedback" script include is called by the "Approve" UI Actions running on [sysapproval_approver].  By adding my conditions for when I need to block the approval to the UI Actions I was able to control when the "ApprovalUserFeedback" script include would be called...and block calling it when I don't want the "Approved Requested Item: XXXXXXXX" info message to show in the first place.

Hi @patricklatella ,

Where did you add the condition to block the approval in the UI Actions to control when the "ApprovalUserFeedback" script include is called? Was it in the business rules?

 

Can you please share the script line here?

 

Thank you