Displaying the Asset tag on the incident form ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2016 05:55 AM
Dear Team,
My requirement is to have the Asset field (Which I have already created) display the Asset tag associated with user . It needs to automatically populate the asset tag in the asset feild (user created) as I select the caller from the caller field. I am able to accomplish populating the email and location as I select the caller but Asset tag is not get populated. I have check that Asset tag is field in "alm_hardware" table which also appears as the link under Asset Application module as "Hardware" . Also I can see that there is an "Assigned To" field in Hardware table which references the sys_user table . Here is code that I have written .
Do I need glide the hardware table ? I am sure I am missing something.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading)
return;
if (newValue == '') {
g_form.setValue('location', '');
g_form.setvalue('u_email', '');
return;
}
var caller = g_form.getReference('caller_id', setLocation);
}
function setLocation(caller) {
if (caller)
g_form.setValue('location', caller.location);
g_form.setValue('u_email', caller.email);
g_form.setValue('u_asset' , caller.asset_tag);
alert(caller.asset_tag);
g_form.getValue(caller.location);
}
Thanks and Regards
Mahendra Paila

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2016 06:09 AM
HI Mahendra,
The thing is - when you pick a user, they only have one location and one email address. However, when you look at the alm_hardware table, they may have more than one asset assigned to them. A phone, a laptop, a vehicle (perhaps). What is your requirement when multiple assets are assigned to one person? Which do you pick to put in that field? Auto populating in this way is nice in theory, but breaks down quickly and may be better left to the user to pick the asset from a list.
Have you considered displaying a related list of assets for that user on the incident form instead?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2016 06:38 AM
Dear Chuck,
Many thanks for response . The reason we sought this kind requirement is to have Service desk confirm the HW asset of the user and change it if that is not correct which automatically update the records in the hardware table. Unfortunately the deployment of Asset and config in SNOW has been a major problem and now the management wants every caller Asset's details to be verified and updated as soon as they called the Service desk . To do that, as you know Incident management form layout does not have feilds which link the user with Asset details . But related list will only display the asset records associated with user , I doubt if Service desk can update them, which in turn gets updated in Hardware table. What your thoughts on it ?
Thanks and Regards
Mahendra Paila

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2016 06:46 AM
Thank you for the details. Based on what you've described, this is less a technical question than a process question at this point. It gets back to the user having multiple assets. What do you want to display in that field?
Perhaps a combination of both a related list of "here is what this user has" and the service desk can ask about that list. If there is one asset, fine, fill it in the reference field (this could be done automatically with a GlideAjax call if one result is returned, but doesn't make sense if more than one assigned asset is found). If there are multiples ask "Are we dealing with your laptop 1044, or the iphone 6 you have today?" If the responds with one of those two assets, fill it in, if it's something else, pick it in the reference field and you've still got a record of which asset it being used.
Those are my initial thoughts. Hope that helps.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2016 06:10 AM
By the way, you posted this in the Singapore User Group section which limits who can see and reply to this message. You must be a member of the group to respond. In the future you may want to target development questions like this in the Developer Community section for better reach.
Thanks.