
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2020 06:33 AM
Like the title says I would like to create a new form button that if clicked would re-direct me to a different module inside the platform and also fill out a field. I have looked at a few other posts on this topic but none of them seem to really be what I am looking for.
Any suggestions on how I may be able to do this?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2020 07:25 AM
Can you try it like this?
var url = "https://MYINSTANCE.service-now.com/u_new_asset.do?sysparm_stack=u_new_asset.do?sys_id=-1%26sysparm_query=u_operation=modify_record^u_select_record=TRP-96J194700345";
action.setRedirectURL(url);
As suggested by the guru:
https://www.servicenowguru.com/service-now-general-knowledge/populating-default-values-url-module/

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2020 07:17 AM
did you access field value and then set it on url ?
eg:
action.setRedirectURL("./project_status.do?sys_id=-1&sysparm_query=project=" + current.sys_id); // This works
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2020 07:25 AM
Can you try it like this?
var url = "https://MYINSTANCE.service-now.com/u_new_asset.do?sysparm_stack=u_new_asset.do?sys_id=-1%26sysparm_query=u_operation=modify_record^u_select_record=TRP-96J194700345";
action.setRedirectURL(url);
As suggested by the guru:
https://www.servicenowguru.com/service-now-general-knowledge/populating-default-values-url-module/

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2020 07:43 AM
It brought me to the correct form but it didn't populate the fields. I tried to use the label and the name of the field but it stays blank. I even tried removing the second parameter to just keep it simple but still nothing. Weird.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2020 08:03 AM
I figured out the problem thanks to your servicenowguru link. Do not add %26 after the sys_id=-1 instead just make it sys_id=-1&sysparm_query=BLAH
Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2024 03:13 AM
@Willem Where to write this code on the Submit UI Action Widget?