We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

I added a related list declarative action Submit, the button does not work

Siris
Tera Contributor

How to add functionality to the button using server script or client script, so that it updates the record state from pending to submitted.

2 REPLIES 2

Ankur Bawiskar
Tera Patron

@Siris 

basically you want Related List action which updates State for selected records?

if yes then did you check any OOTB Related List actions how they are doing

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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

sivasankaris
Tera Guru

Hi @Siris 

You can achieve this using a UI Action — that’s the cleanest and recommended way.

Go to System Definition → UI Actions and create a new one on your table.

  • ✔ Check Form button

  • ✔ Set a condition like: current.state == 'pending'

Then in the Script section (server-side):

current.state = 'submitted';
current.update();
gs.addInfoMessage("Record submitted successfully.");
action.setRedirectURL(current);
 

That’s it 😊

When the button is clicked, it will securely update the record from Pending → Submitted.

 

If this works, please mark it as helpful and please accept my solution..