- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2022 07:01 PM
After submitting a record in the service portal, what script should I write in the UI action to return to the previous screen?
Please let us know.
In the URL of the screen where you press the [New] button to create a record
SySID of the record associated with the new record is embedded in the URL of the screen where the [New] button is pressed to create a record.
It looks like this
ex) https://[ inctance name ].service-now.com/sp?id=lf&table=[ table name ] &filter=[ table name 2 ]%3D{ Sysid }&view=[ View name ]
We apologize for our poor English.
Best regards.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2022 06:47 PM
After researching, we learned that UI actions are not supported in the Service Portal.
Therefore, we will give up on this implementation.
Thank you very much.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2022 07:17 PM
Hi @Yokota Misaki ,
You have marked your own answer as Correct mistakenly !! As that's not correct answer.
you can only show UI actions on the form in portal which are Server Side.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2022 07:11 PM
Hi @Yokota Misaki ,
This solution should help you :
https://www.servicenow.com/community/developer-forum/back-button/m-p/2146388
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2022 07:21 PM
Thank you Sandeep Dutta.
I did look over that too, but HTML should not be available in the UI action that creates the button.
What code should I write to adapt it in the UI action?
I currently have the code written as follows
window and location are not defined and I get an error.
action.setRedirectURL(current);
current.update();
action.setRedirectURL(window.location=history.back);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2022 07:11 PM
For your information, the URL of the transition source is as follows.
[ inctance name ].service-now.com/sp?id=form&table=[ table name ]&view=[ View name ]sys_id=-1&query=[ table name 2 ]%3D{ Sysid }
The URL you want to set as the transition destination is as follows.
[ inctance name ].service-now.com/sp?id=lf&table=[ table name ] &filter=[ table name 2 ]%3D{ Sysid }&view=[ View name]
Sys id is the same for both source and destination of transition.
Thanks in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2022 07:16 PM
Yes!! SysID is same.