- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-08-2020 11:24 AM
One of the default redirect options in a record producer is to redirect users to the generated task record (ID=ticket). I want to send users to a different variation of that form but I'm unsure how to derive the Sys_id of the newly submitted record producer. I know I can use this to redirect:
producer.portal_redirect = "sp?id=calscbo_home";
But how do I get the newly created Sys_id into the url? For instance, if I use the default redirect, this is what I'd see in the url:
How do I get that sys_id into the url using [producer.portal_redirect = "sp?id=calscbo_home"] bit of code?
Scott
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-08-2020 12:06 PM
The sys_id should be available. So that means you just have a syntax error. Looking at the code you pasted, the " is off.
Try for example:
producer.portal_redirect = "sp?id=cals_cbo_ticket&table=x_nocsu_cals_cbo_req&sys_id="+current.getUniqueValue();
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP
---
LinkedIn
Community article list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-08-2020 11:29 AM
Hi there,
This is about using the Record Producer script field, correct? If so, you could just use current.getUniqueValue() or current.sys_id.
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP
---
LinkedIn
Community article list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-08-2020 11:49 AM
Hi Mark,
When I try this, I don't think it knows the current sys_id yet:
producer.portal_redirect = "sp?id=cals_cbo_ticket&table=x_nocsu_cals_cbo_req&sys_id=current.getUniqueValue()";
So all that gets passed is the exact characters in the url, not the value of current.getUniqueValue().
There has to be a way to do it since it works for ID=ticket, I'm just not sure how to get that value into the url so I can use it to pull up the ticket form on my variant page.
Scott

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-08-2020 12:06 PM
The sys_id should be available. So that means you just have a syntax error. Looking at the code you pasted, the " is off.
Try for example:
producer.portal_redirect = "sp?id=cals_cbo_ticket&table=x_nocsu_cals_cbo_req&sys_id="+current.getUniqueValue();
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020 ServiceNow Community MVP
2020 ServiceNow Developer MVP
---
LinkedIn
Community article list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-09-2020 04:30 AM
Hi Mark,
While I'm embarrassed it was something so simple, I greatly appreciate the help. Thank you!
Scott