Hidden fields appearing on RITM form in Service Portal

Kai Tingey
Tera Guru

Hi All

I have an issue with one of my catalog items, where the RITM page on the portal is showing a hidden field after you submit the request.

For example, here is the form

find_real_file.png

a client script is hiding some fields (i am using a client script because the field values are being generated dynamically by another client script... it's a painful form)

however when you hit submit, one of the hidden fields is shown on the RITM page

find_real_file.png

There is a a UI policy that hides all these fields on form load, then the client script takes care of turning them on or off depending on what the user selects. Both the script and UI policy are set to apply to cat items, req items and cat tasks.

find_real_file.png

this is the script

function onChange(control, oldValue, newValue, isLoading) {
   if (isLoading || newValue == '') {
      return;
   }
	
if (g_form.getValue('gis_request_category') == 'gis_map_production'){
	g_form.setDisplay('gis_map_production_form',true);	
	g_form.setDisplay('gis_interactive_map_form',false);	
	g_form.setDisplay('gis_service_type',false);
	g_form.setDisplay('gis_data_request_type',false);
	g_form.setDisplay('gis_user_request_type',false);
}
else if (g_form.getValue('gis_request_category') == 'gis_interactive_map_request'){
	g_form.setDisplay('gis_interactive_map_form',true);	
	g_form.setDisplay('gis_map_production_form',false);	
	g_form.setDisplay('gis_service_type',false);
	g_form.setDisplay('gis_data_request_type',false);
	g_form.setDisplay('gis_user_request_type',false);
}
	
else if (g_form.getValue('gis_request_category') == 'gis_imagery_services'){
		g_form.setDisplay('gis_service_type',true);
		g_form.setDisplay('gis_interactive_map_form',false);	
		g_form.setDisplay('gis_map_production_form',false);	
		g_form.setDisplay('gis_data_request_type',false);
		g_form.setDisplay('gis_user_request_type',false);
}
	
else if (g_form.getValue('gis_request_category') == 'gis_data_management'){
		g_form.setDisplay('gis_interactive_map_form',false);	
		g_form.setDisplay('gis_map_production_form',false);	
		g_form.setDisplay('gis_service_type',false);
		g_form.setDisplay('gis_data_request_type',true);
		g_form.setDisplay('gis_user_request_type',false);
		g_form.clearValue('gis_user_request_type');
}
else if (g_form.getValue('gis_request_category') == 'gis_user_management'){
		g_form.setDisplay('gis_interactive_map_form',false);	
		g_form.setDisplay('gis_map_production_form',false);	
		g_form.setDisplay('gis_service_type',false);
		g_form.setDisplay('gis_data_request_type',false);
		g_form.setDisplay('gis_user_request_type',true);	
		g_form.clearValue('gis_data_request_type');
}
	
else if (g_form.getValue('gis_request_category') != 'gis_interactive_map_request' | g_form.getValue('gis_request_category') != 'gis_map_production'){
		g_form.setDisplay('gis_interactive_map_form',false);	
		g_form.setDisplay('gis_map_production_form',false);	
		g_form.setDisplay('gis_service_type',false);
		g_form.setDisplay('gis_data_request_type',false);
		g_form.setDisplay('gis_user_request_type',false);
}


   
}

Also if anyone knows how to get the RITM form to display the label for request category, rather than the value, that would be handy. The request category is one where the list values are generated dynamically (hence the need for a script)

1 ACCEPTED SOLUTION

Hang on, i think i know

 

the script is clearing the values in the other two fields. Whereas service type has a value in it whether it's hidden or not, so i bet that's the problem.

View solution in original post

13 REPLIES 13

Hang on, i think i know

 

the script is clearing the values in the other two fields. Whereas service type has a value in it whether it's hidden or not, so i bet that's the problem.

or operator need to update as well in script "||"

else if (g_form.getValue('gis_request_category') != 'gis_interactive_map_request' || g_form.getValue('gis_request_category') != 'gis_map_production'){

How did you solve the problem?

This was a while ago - but from memory - basically the issue was that if the field is populated with any value, it will be visible no matter what. I set it to clear the value if the field was hidden and that resolved it i think

Thank you Kai for the fast reply.

 

I'm getting the same problem but with selectbox field in record producer. I've already tryied g_form.clearOptions and set "clear value" in UI Policy, but when i submit the request, the summary is displaying the selecbox variable even it is hidden on the form.

 

Any thought?