- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-22-2023 12:14 AM - edited ‎12-22-2023 12:17 AM
Hi All,
Can anyone please help us on the below issue.
We have created one UI action and UI page to redirect the catalog items and order guides to service portal and it's working fine for catalog items.
But when it comes to Order guides also it's re directing as normal catalog item on portal level
Ui Action:
Name: Try in Portal
Table: Catalog item (sc_cat_item)
onClick: openPortalPageList()
condition: current.active == true
Script:
Name: try_item_portal_page
HTML:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-22-2023 01:21 AM
Hello @LaraReddy
It seems like there might be an issue in how the order guides are being handled in the redirection process. Let's take a closer look at your UI action script.
function openPortalPageList() {
var itemID = g_form.getUniqueValue();
var gdwPortals = new GlideDialogWindow('try_item_portal_page');
gdwPortals.setTitle('Try Portal Page (select portal)');
gdwPortals.setPreference('portal_page_id', 'sc_cat_item');
gdwPortals.setPreference('item_id', itemID);
gdwPortals.render();
}
It looks like you are setting the 'portal_page_id' preference to 'sc_cat_item', which might be causing the redirection to treat it as a catalog item. You need to dynamically determine whether the current item is a catalog item or an order guide and pass that information to the UI page.
You can modify your UI action script like this:
function openPortalPageList() {
var itemID = g_form.getUniqueValue();
var itemType = g_form.getValue('type'); // Assuming 'type' is a field that distinguishes between catalog items and order guides
var gdwPortals = new GlideDialogWindow('try_item_portal_page');
gdwPortals.setTitle('Try Portal Page (select portal)');
gdwPortals.setPreference('portal_page_id', itemType);
gdwPortals.setPreference('item_id', itemID);
gdwPortals.render();
}
This modification assumes that there is a field named 'type' on the form that holds the information about whether the item is a catalog item or an order guide. Adjust the field name based on your data model.
Make sure to check how the 'type' field is populated for order guides, and update the script accordingly. This way, you can pass the correct information to the UI page and handle the redirection accordingly.
Please Mark my Solution as Accept and Give me thumbs up, if you find it Helpful.
Thanks & Regards,
Kartik Magadum
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-22-2023 01:21 AM
Hello @LaraReddy
It seems like there might be an issue in how the order guides are being handled in the redirection process. Let's take a closer look at your UI action script.
function openPortalPageList() {
var itemID = g_form.getUniqueValue();
var gdwPortals = new GlideDialogWindow('try_item_portal_page');
gdwPortals.setTitle('Try Portal Page (select portal)');
gdwPortals.setPreference('portal_page_id', 'sc_cat_item');
gdwPortals.setPreference('item_id', itemID);
gdwPortals.render();
}
It looks like you are setting the 'portal_page_id' preference to 'sc_cat_item', which might be causing the redirection to treat it as a catalog item. You need to dynamically determine whether the current item is a catalog item or an order guide and pass that information to the UI page.
You can modify your UI action script like this:
function openPortalPageList() {
var itemID = g_form.getUniqueValue();
var itemType = g_form.getValue('type'); // Assuming 'type' is a field that distinguishes between catalog items and order guides
var gdwPortals = new GlideDialogWindow('try_item_portal_page');
gdwPortals.setTitle('Try Portal Page (select portal)');
gdwPortals.setPreference('portal_page_id', itemType);
gdwPortals.setPreference('item_id', itemID);
gdwPortals.render();
}
This modification assumes that there is a field named 'type' on the form that holds the information about whether the item is a catalog item or an order guide. Adjust the field name based on your data model.
Make sure to check how the 'type' field is populated for order guides, and update the script accordingly. This way, you can pass the correct information to the UI page and handle the redirection accordingly.
Please Mark my Solution as Accept and Give me thumbs up, if you find it Helpful.
Thanks & Regards,
Kartik Magadum