button in the incident saved and closed

yardenKrispel
Tera Contributor

Hey! I need to create a button in the incident
called save and closed and its purpose is that I go into the incident form and then I change something and then I want to save and after the save it goes out of the form to the list of incidents, it's not that the status will become closed, that's not the intention, but after I save it automatically goes to the list! The following code works partially, it saves the changes but does not go back to the list of incidents. How do I do it? 

yardenKrispel_0-1702795287824.png

 

3 REPLIES 3

Maik Skoddow
Tera Patron
Tera Patron

Hi @yardenKrispel 

the required functionality is already performed by the "Update" button. So why do you want to reinvent the wheel?

Maik

True, but I need it in the workspace, how do I make it there too?

Aniket Chavan
Tera Sage
Tera Sage

Hello @yardenKrispel 

I just simply tried with the below code and it worked expected as it saved the currect record and redirected to incident list view.

AniketChavan_1-1702801467136.png

 

current.update();
var url = current.getTableName() + '_list.do';
action.setRedirectURL(url);

 

Let me know your views on this and Mark Correct if this solves your query and also mark 👍Helpful if you find my response worthy based on the impact.


Regards,
Aniket