'Record Updated' message is coming even the record is not updated

Amol Pawar
Tera Guru

Hi All,

I have created a UI action 'Reject' for a form with the below script:

AmolPawar_0-1696400960370.png

When I try to reject the request by clicking on 'Reject' it shows an error as comments are mandatory which is correct but at the same time it shows one message that 'Record updated'. Why this is happening?

Because it should not update the request if comments are empty. I want to hide that message as 'Record Updated'.

AmolPawar_0-1696401333283.png

 

Thanks in advance,

Amol

 

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@Amol Pawar 

inside the else you should use return false

try that once

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

View solution in original post

2 REPLIES 2

Ankur Bawiskar
Tera Patron
Tera Patron

@Amol Pawar 

inside the else you should use return false

try that once

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

Hi @Ankur Bawiskar,

Thank you for you reply.

I have used current.setAbortAction(true); below the error message and it worked for me.

Thanks,

Amol