Need to populate Asset Serial number in service catalog variable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2023 09:49 PM
Hi All,
Need to populate requested for assets in lookup variable in catalog.
we have a requested for variable and we need to get the value of requested for Assets serial number from the (Alm_hardware ) table to populate in (serialnumber_varible ) lookup select box in catalog item.
Please suggest.
Thank you all.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-04-2023 01:06 AM
if user has multiple assets then which one you want to populate in that lookup variable?
why not allow them to select the assets which are assigned to them since you will apply reference qualifier on that lookup?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-04-2023 01:17 AM - edited 07-04-2023 01:50 AM
After applying the reference qualifier without selecting (requested_for) few asset are populating, But not sure how they populates.
Please suggest.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-04-2023 02:00 AM
advanced ref qualifier will filter it and client script won't allow user to select anything in 2nd variable unless 1st is having some value.
make the 2nd variable editable only when some value is selected in requested_for
write onChange catalog client script on requested_for and do that
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading)
return;
if(newValue === '')
g_form.setReadOnly('serialnumber_varible', true);
else
g_form.setReadOnly('serialnumber_varible', false);
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-04-2023 02:27 AM
I have implimented above provided script. But serial number not papulating based requested for.
There are multiple serial number are populating instead of requetsed for serial number.
Please suggest.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-04-2023 02:51 AM
can you share what script did you use along with screenshots?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader