- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2023 04:54 AM
I am unable redirect to any URL using setRedirect in server side script of the widget i am working on. Can someone help on how can we do that or where is the issue.
Added the code snippets.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2023 05:08 AM
Hello @Amit Kumar21
Let me know if my understanding is wrong. In portal, in request item status page, you want to show a button/link on clicking of that button/link, user should be redirected to the catalog item page.
If yes, current solution is not good as it is making additional server call. updated solution below:
1. in server script, I can see you have the requestGr object which I am assuimg the GlideRecord object of the RITM record. You can save the sys_id of the catalog item in data object in server script as below:
data.cat_item_link = "?id=sc_cat_item&sys_id" + requestGr.getValue("cat_item");
2. in html, remove onclick attribute and update href as href='{{c.data.cat_item_link}}'
Thanks,
Ali
Thank you,
Ali
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2023 10:47 PM
Hello @Amit Kumar21
Use action.setRedirectURL('')
Plz Mark my Solution as Accept and Give me thumbs up, if you find it Helpful.
Regards,
Samaksh