- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-26-2020 11:34 PM
we have a catalog variable in one item, serial number
in this serial number, serial number of the asset of that user contains has to populate.
here am attaching the user record form, the asset attached to this user record. serial number will be in this asset table (alm_hardware)
so we need to have onchange client script and one script include.
by changing the user in the catalog item, the serial number has to change based on the user.
in this variable, the serial number has to populate
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-27-2020 05:07 AM
add alert(g_form.getValue('user')); and check what is the user.
Then go to alm_hardware.list and there add filter assigned_to and put this user and check the no. of entries it has.
Compare it with the output of SI
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-27-2020 03:14 AM
have changed, still not working Asif
did it worked you side? this scenario

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-27-2020 03:44 AM
Yes, the code is working fine. I tested on change of caller id in incident table and set the assets in the short_description field and its working fine.
1. change that parameter which i mentioned above
2. Ensure the onchange client script field is selected correctly
3. Check if the field name is correct "the_serial_registered_for_the_user_is"
Lastly add logs and check
Mark the comment as a correct answer and helpful once worked.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-27-2020 04:34 AM
i have modified my client script to run onLoad as well,
but there is some problem the field is showing details populated wrongly.
tthis is client script modified,
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
// Call the GA function
var ga = new GlideAjax('userInfoAjax');
ga.addParam('sysparm_name', "getAssets");
ga.addParam('sysparm_user', g_form.getValue('user'));
ga.getXMLAnswer(function(answer){
g_form.setValue('the_serial_registered_for_the_user_is', answer);
});
return;
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-27-2020 05:07 AM
add alert(g_form.getValue('user')); and check what is the user.
Then go to alm_hardware.list and there add filter assigned_to and put this user and check the no. of entries it has.
Compare it with the output of SI

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-28-2020 03:25 AM
Kindly mark the comment as a correct answer and also helpful if this answers your question.