showFieldMessage issue

Community Alums
Not applicable

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.")
	}


}

 

 

 

catalog client script.PNG

 

esc.PNG

 

no.PNG

 

variable.PNG

 

Regards

Suman P.

1 ACCEPTED SOLUTION

Samaksh Wani
Giga Sage
Giga Sage

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');

 

 

View solution in original post

11 REPLIES 11

Sonu Parab
Mega Sage
Mega Sage

Hello @Community Alums ,
I have implemented same scenario on my PDI and its script is working fine.

 

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.");

 

Here, 'configuration_management' is my another variable name. where I want to show the field message when I select Process Area as Configuration Management.
It look like this.

SonuParab_0-1692203848582.png
But If you want to show the field message on the Process Area field then You have to pass the Process Area variable name instead of 'configuration_management'.
the script looks like this.

 

g_form.showFieldMsg('process_area', "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.");

SonuParab_0-1692206012304.png

 

 

 

If my answer solved your issue, please mark my answer as  

 

Correct & 

 

Helpful

Thanks,

 

Samaksh Wani
Giga Sage
Giga Sage

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');