
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-28-2018 11:14 AM
Hi everyone,
So I've googled for quite some time to try and see how to go about doing this, but I'm struggling. This isn't your ordinary navigate by URL schema, please take note that it's for the Service Portal, specifically. And by that, I have an icon-link, I would like to have that point to the create incident record producer (which is a catalog item and so I'm unable to follow this format: https://<instance name>/<sp url suffix>?id=<page id>&<page parameters>).
How can I set up a widget to navigate to the record producer (customer facing, not back-end form view) of the incident within the service portal AND fill in specific values for category, subcategory etc.?
I figured out the URL schema for the SP to open the back-end incident form and fill in values, but I need the customer facing version.
Anyone got any ideas?
Or how can I take: sp?id=sc_cat_item&sys_id=<sysid of record producer> and somehow pass values to that, unfortunately I don't think that's allowed. As I'd need to replace sys_id in that line to sys_id=-1 to be able to open a form to create, but again, it won't know which record producer or category item to open as we just took that sys_id out...
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-28-2018 12:51 PM
I found the mistake of my ways. So it seems that $scope.page.g_form isnt available to all widgets. I had to add a macro with a "widget" set to the new widget.
then it works.
So you'd have to add that variable on every form you want this to work on.
If you want to see it in action, hit me up on sndevs.slack.com @jace invite url: https://snowslack.herokuapp.com/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-06-2018 12:54 PM
I'm surprised this isn't a more common request. I'd like to bring someone from a ticket conversation view into a record producer in the service portal, with the previous records sys id set in one of the fields. (Allowing customer to Create Incident from existing Task is the use case).
Can someone share the steps for accessing stored values in $scope or elsewhere from a record producer client script?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-06-2018 04:32 PM
I’d recomend openings new post for better visibility. But. You should be able to access the $scope variable this same way. Just modify what I did for this. https://blog.jacebenson.com/post/2018-07-15-sp-set-variables-via-url/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-12-2024 07:20 AM - edited ‎06-12-2024 07:25 AM
I know this was quite a few years ago since this thread was originally raised.
I am trying this on a incident form, - created a script to add cmdb_ci, asset_tag and a description field to the url, I can see that now,
Added the widget above to the form page
In the console log, I get the following for the fields I want to update
Error setting field TypeError: Cannot read properties of undefined (reading 'setValue')
id=form&table=incident&sys_id=-1&sysparm_query=cmdb_ci%3DMacBook%20Pro%2017%22&short_description=Incident%20for%20Asset:%20MacBook%20Pro%2017%22&description=Asset%20Tag:%20P1000412
I've noticed that my script setting the url removes the sp, as working on an MSP where the service portal could be askIT or DigitalDesk for another customer.
Any thoughts?