How to customize "Submit" button UI action on a new incident report created

Milan13
Giga Expert

Hello,

I need to customize the submit button once a new incident is generated in such a way that once clicked it keeps its original functionality with one difference - after clicking the button, user stays on the incident form being submitted.

I can't find the "Submit" button in list of UI actions for table incident either...

Many thanks.

Milan

find_real_file.png

1 ACCEPTED SOLUTION

AbhishekGardade
Giga Sage

Hello Milan,

You can achieve above functionality but you need to modify the Out of the Box UI action. As it is created on Global, changes will be applicable for globally i.e on all the form where Submit button(UI action) is available.

1. You can create new UI Action by copying same code or you can have the option to INSERT and STAY.

2.You need to override existing UI action with New UI action. So you can see only one UI action on Incident form with your own functionality.

3. To stay in Current form,you can use following code.

 action.setRedirectURL(current);

Please mark answer correct if you find it as helpful.

Thanks,

Abhishek Gardade

Thank you,
Abhishek Gardade

View solution in original post

3 REPLIES 3

Jaspal Singh
Mega Patron
Mega Patron

Hi Milan,

 

You are not able to see the Submit UI Action in the UI Action table as there isn't anything for Incident. The one that exists is Global.

In order to achieve what your business requirement is I would do a insert & stay for the existing Global Submit UI Action & remove necessary condition & tweak the code that would redirect me to the same in page. In this case you will end up with 2 Submit UI Actions, 1 on Global table while the other on Incident table with modified conditions so as to make it work as Save UI Action.

 

Thanks,

Jaspal Singh

 

Hit Helpful or Correct on the impact of response.

Harsh Vardhan
Giga Patron

This is OOTB "Submit" button functionality. if you will hit on submit button it will not stay on the form . 

 

if you wanna add the functionality to stay on the form then add the below code in the GLOBAL "submit" UI Action. 

 

answer = current.insert();
gs.include('ActionUtils');
var au = new ActionUtils();
au.postInsert(current);
if(current.getTableName()=='incident')
 action.setRedirectURL(current);

 

Note: i have added the condition so it will only be applicable for incident table . 

AbhishekGardade
Giga Sage

Hello Milan,

You can achieve above functionality but you need to modify the Out of the Box UI action. As it is created on Global, changes will be applicable for globally i.e on all the form where Submit button(UI action) is available.

1. You can create new UI Action by copying same code or you can have the option to INSERT and STAY.

2.You need to override existing UI action with New UI action. So you can see only one UI action on Incident form with your own functionality.

3. To stay in Current form,you can use following code.

 action.setRedirectURL(current);

Please mark answer correct if you find it as helpful.

Thanks,

Abhishek Gardade

Thank you,
Abhishek Gardade