
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2023 08:16 AM - edited 08-16-2023 08:20 AM
Hi,
I am working on a 'selectbox' variable and each option has to give a different message. I have written a catalog client script. Message is not displayed. Kindly help
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var pa = g_form.getValue("process_area");
alert(pa);
if(pa == 'configuration_management'){
g_form.showFieldMsg('configuration_management', "Configuration Management for requests related to Configuration Items (CIs) in the Configuration Management Database (CMDB). CI examples: Application Services, Business Applications, Dynamic CI Groups, and Virtual Servers.");
}
else if(pa == "hardware_asset_management"){
g_form.showFieldMsg("hardware_asset_management", "Hardware Asset Management for requests related to hardware assets. Hardware examples: Desktops, Laptops, and Wireless.");
}
else if(pa == "logistics"){
g_form.showFieldMsg("logistics", "Logistics for desktop software requests and questions related to the purchasing of IT assets.");
}
else if(pa == "program"){
g_form.showFieldMsg("program", "Program for requests related to the overall IT Asset and Configuration Management program and for enhancement and reporting requests.");
}
else if(pa == "software_asset_management"){
g_form.showFieldMsg("software_asset_management", "Software Asset Management for requests related to software assets. Software examples: Microsoft and Adobe entitlements.")
}
}
Regards
Suman P.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2023 10:08 AM
Hello @Community Alums
You should pass the backend Name of field but you're passing backend name of choices
It should be :-
g_form.showFieldMsg('process_area', "your content msg",'info');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2023 08:24 AM
@Community Alums
try Clearing the value first and then display error/info message then it will work. try in this format.
g_form.clearValue('process_area');
g_form.showFieldMsg('process_area', 'your message ', 'info');
Thanks,
Manjusha Bangale

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2023 08:29 AM
We are trying to clear after the process_area is selected, it will always show None.
Regards
Suman P.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2023 08:42 AM
Hello @Community Alums
if (pa == 'configuration_management') {
g_form.showFieldMsg('configuration_management', "Configuration Management for requests related to Configuration Items (CIs) in the Configuration Management Database (CMDB). CI examples: Application Services, Business Applications, Dynamic CI Groups, and Virtual Servers.", 'info');
}
remove false from your code.
Plz Mark my Solution as Accept and Give me thumbs up, if you find it helpful.
Regards,
Samaksh

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2023 08:44 AM
I tried that thing first before i add false, not sure what is wrong here.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2023 08:53 AM
Hello @Community Alums
Try true instead of false.