Catalog Client Script issue with clearValue() and showFieldMsg() in London

Matthew Glenn
Kilo Sage

Just upgrade my DEV instance from Jakarta 8b to London P1H1 and am having an issue I can't quite figure out

In both our DEV and PROD instances, I have the following snippet of code in an onChange Catalog Client Script

function displayMessage(){
	getMessage("generic message goes here",function(msg){	
		g_form.clearValue("field_name");
		g_form.showFieldMsg("field_name", msg, "error");
	});
}

This snippet works without issue in PROD (still on Jakarta), however, it doesn't work in DEV (now on London). If I comment out either the clearValue() or showFieldMsg() calls, the script runs without issue. When I attempt to let them run together, clearValue() works maybe 10% of the time, and if it does it's only on the first onChange event after the page load. 

No console errors to speak of and I don't see anything in published known errors. 

Has anyone else experienced this?

6 REPLIES 6

Mike Patel
Tera Sage

try setValue instead of clear

g_form.setValue("field_name", '');

Same outcome, unfortunately. Works if I remove showFieldMsg(), but not when used together

 

g_form.setValue("field_name", ''); or g_form.clearValue("field_name"); neither works in combination with g_form.showFieldMsg() or g_form.showErrorMsg() or alert();

Vaiju
Giga Contributor

Hello Team,

 

Just FYI.

 

In London version they have introduced 2 new fields on variable set form ;

  1. “Internal name” : We need to use this field value in all scripts instead of “Title” field value.
  2. “Type” : Variable set type as “Single Row” and “Multi Row”.

 

In all present scripts we used variable set “Title” field value, I will replace it with “Internal name” field value.

 

https://docs.servicenow.com/bundle/london-it-service-management/page/product/service-catalog-managem...

 

 

Best regards,

Vaijanath Shintre