- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-24-2024 10:18 AM
Hi Team,
I am having 2 reference Variables.
1. Serial Number (alm_hardware table)
2. Hardware item (cmdb_hardware_product_model table)
In serial number if I select any record for that record we have model category. Let take I have selected 'Lenovo' for this record model category is "personal computer".
In Hardware Item Variable, I need to show on "personal computer" model category only.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-24-2024 11:09 PM
Hi @Gopal14 ,
Your client script seems to be having issue, please try the below one :
Client script:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue === '') {
return;
}
var ga = new GlideAjax('GetProductModelBySerial');
ga.addParam('sysparm_name', 'getProductModel');
ga.addParam('sysparm_serial_number', newValue);
ga.getXML(getProductModelParse);
function GetDFcabParse(response) {
var answer = response.responseXML.documentElement.getAttribute("answer");
console.log(answer);
g_form.setValue('hardware_item_variable', answer);
}
}
Script Include:
Use the same one which you have created.
You can check whether you are getting the value in console of the browser which can be accessed by pressing Ctrl+shift+i and clicking console tab, search for the model name to see if it printed it or not.
Please mark my answer "Helpful" and "correct" if you feel that it has helped you in any way.
Thanks and Regards,
K. Sai Charan
Sr. ServiceNow Developer
Deloitte India
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-25-2024 01:50 AM - edited 09-25-2024 01:52 AM
It's just doing the auto-population for you. If you click on the reference icon, you will get list of all model categories to select from.
Please mark this response as correct and helpful if it assisted you with your question.