- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2022 03:00 AM
Hi ,
we have a catalog item (first RITM) that collects the info of devices (laptops and peripherals) for the new user. When the user is not joining, then there is a new catalog item (second RITM) which needs to collect all the devices provided in the previous request. How to show all the devices tagged to the person from first RITM in the second RITM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2022 02:41 AM
Hi,
I believe "devices_to_be_returned" is referring to model table
update as this
var getMyDevices = Class.create();
getMyDevices.prototype = Object.extendsObject(AbstractAjaxProcessor, {
getDevices: function() {
var user = this.getParameter('sysparm_user');
var arr = [];
var gr = new GlideRecord("sc_req_item");
gr.addQuery("cat_item.name", "RITM 1"); // name of your catalog item
gr.query();
while (gr.next()) {
if (gr.variables.requested_on_behalf_of == user)
arr.push(gr.variables.model.sys_id.toString());
}
return arr.toString();
},
type: 'getMyDevices'
});
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2022 09:30 AM
When you say "collects info of devices", where is it stored?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2022 09:46 PM
Hi,
Ideally as per the flow created by previous developers , these should be stored in alm_hardware table. But I couldn't find any of these in alm_hardware table not sure why, probably flow must be discontinued somewhere.
currently what I am doing is that:
RITM -1
user submits requests by selecting Requested for and Model (referring to hardware model table)
RITM-2
there are two fields- Requested for and Devices to be returned
when requested for is selected then all the devices which are requested by him using RITM1 should be populated in Devices to be returned field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2022 09:51 PM
Hi,
I shared solution for something similar and it has worked for the member
check that and enhance as per your requirement
Populate all RITM numbers of selected user in catalog item.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2022 10:01 PM
Hi
Instead of showing RITMs on the user name, How can I show all the devices which he ordered using the "RITM-1" in a list collector field.?
In the above solution you have given this "arr.push(gr.getValue('number'));"
can I do something here like "arr.push(gr.variables.getValue('devices_ordered'))
Can you please let me know how to get info like this from variable of another RITM?