How to stop record submission from UI action?

Karthik Reddy T
Kilo Sage

Hi all,

I want to create a new record in another table(extend from the parent) when click on the Parent table UI action . It was working fine and coming the related list of parent record.

My requirement is :

When user click on UI action it will redirect to child table and stop save the record until user click on save or submit.

If user click on reload form or page or frame or back in the browser record couldn't be     saved.

Karthik Reddy T.
ServiceNow Commnunity MVP -2018 class.
1 ACCEPTED SOLUTION

Gurpreet07
Mega Sage

Hi Karthik,



OOTB the new Ui Action in the related lists do not insert the record until its not manually saved by user. Have you created a custom ui action for this functionality?


If you have created a custom ui action just to populate some information in the new record then same is possible with URL itself. redirect user to


table_name.do?sys_id=-1&sysparm_query=parent=<parent_sys_id>


View solution in original post

4 REPLIES 4

amaradiswamy
Kilo Sage

Hi Karthik,



You can redirect a record with sys_id=-1, then system recognizes it as a new record.



Regards


Swamy


Hi Swamy,



Thanks for the response.



With sys_id=-1, then system recognizes it as a new record and that's fine.



But


When user click on UI action it will redirect to child table and stop save the record until user click on save or submit.



If user click on reload form or page or frame or back in the browser record couldn't be     saved.


Karthik Reddy T.
ServiceNow Commnunity MVP -2018 class.

joshualazzarus
Mega Contributor

Hi Karthik,



You can use setRedirectURL and setReturnURL in your UI action.



Thank You.


Gurpreet07
Mega Sage

Hi Karthik,



OOTB the new Ui Action in the related lists do not insert the record until its not manually saved by user. Have you created a custom ui action for this functionality?


If you have created a custom ui action just to populate some information in the new record then same is possible with URL itself. redirect user to


table_name.do?sys_id=-1&sysparm_query=parent=<parent_sys_id>