Submit button functionality

_SnowDeveloper
Tera Contributor

Hi,

We have a requirement to make the change request form to stay on the current page on clicking submit. 

Here is the code:

Condition: current.canCreate()

answer = current.insert();
gs.include('ActionUtils');
var aUtil = new ActionUtils();
aUtil.postInsert(current);
action.setRedirectURL(current);

 

On creating new change record it is working but if we create change record from "Copy Change" UI action it is redirecting to previous screen.

 

Can anyone help with this?

 

Thanks in advance

4 REPLIES 4

Kapil Khedkar
Tera Contributor

Hi @_SnowDeveloper

Can you please try the below mentioned code

Condition: current.canCreate()
var answer = current.insert();
gs.include('ActionUtils');
var au = new ActionUtils();
au.postInsert(current);
var url=answer.getLink(true);
action.setRedirectURL(url);

 

Regards,

Kapil Khedkar

Thank you, but it didn't work.

Use case is: 1. click "copy change" then change form will open
2. then after clicking on "Submit" it should stay on the same page

Maik Skoddow
Tera Patron
Tera Patron

Hi

the "Copy Change" UI Action is a completely different functionality and thus cannot be mixed.

Maik

Hi,

Thank you.

Please let me know, if you have any suggestions to achieve that use case