- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2022 09:25 AM
Hello
I want to display Item name from RITm on request when we click on View All in open request in service portal.
widget is Data Table from URL Definition
Please find the attached screen shot . I want to show the Item name in short description .
Please let me know How we can achieve
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2022 06:55 AM
Hi Nisha,
Your script looks incorrect to me for your scenario. Please refer to the script shared above by me. That will work and I have tested it as well.
Sharing it below for your reference again:
If it does not work then please share your version of code along with screenshot after making it similar to mine and let me know.
BR Details:
Table Name: Requested Item(sc_req_item)
When: After Insert
Script:
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var gr = new GlideRecord('sc_request');
gr.addQuery('sys_id',current.request);
gr.query();
if(gr.next()){
if(JSUtil.nil(gr.short_description)){
gr.short_description = current.getDisplayValue('cat_item') + '\n';
}else if(JSUtil.notNil(gr.short_description)){
gr.short_description += current.getDisplayValue('cat_item');
}
gr.update();
}
})(current, previous);
Screenshot as well for reference:
This will show the Catalog item Name in your portal as well.
Hope this helps. Please mark the answer as correct/helpful based on impact.
Regards,
Shloke
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2022 09:40 AM
Hi,
i don't think this is possible as a single REQ can have multiple RITM records and RITM is a child table to REQ so you will not be able to dot walk in as well and show the item name here.
You can configure another list to be shown on your portal where you can display the RITM directly and add ITEM column in List view which you want, but cannot display it in Request list.
Hope this helps. Please mark the answer as correct/helpful based on impact.
Regards,
Shloke
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2022 09:54 AM
Hello Shloke
Thanks for your reply , Can we achieve these through business rule by setting the short description on request by the RITM catalog item name.
There we can display all the cat item name and setting them in short description and that short description can be use in list view in portal.
Please le me know is these is correct or not
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2022 03:25 AM
Yes, technically this is possible.
What you can do here is write a After Insert Business Rule on Requested item table and use the script below:
BR Details:
Table Name: Requested Item(sc_req_item)
When: After Insert
Script:
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var gr = new GlideRecord('sc_request');
gr.addQuery('sys_id',current.request);
gr.query();
if(gr.next()){
if(JSUtil.nil(gr.short_description)){
gr.short_description = current.getDisplayValue('cat_item') + '\n';
}else if(JSUtil.notNil(gr.short_description)){
gr.short_description += current.getDisplayValue('cat_item');
}
gr.update();
}
})(current, previous);
Screenshot as well for reference:
This will show the Catalog item Name in your portal as well.
Hope this helps. Please mark the answer as correct/helpful based on impact.
Regards,
Shloke
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2022 05:21 AM
Hello Sholke,
This script is not working at all it is not going inside the loop can you please help on this
Thanks