Adding hyperlink on a error message of a field in the catalog item

shreya N shetty
Tera Contributor

i have a catalog client script which  is as below 

function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}

var ga = new GlideAjax("catalog");
ga.addParam("sysparm_name", "checkChildCI");
ga.addParam("sysparm_appModel", newValue);
ga.getXMLAnswer(getAssetAnswer);
}

function getAssetAnswer(answer){
if(answer == "false"){
g_form.hideErrorBox("field name");
return;
}
g_form.clearValue("field name");
g_form.showErrorBox("field name",getMessage("This application model still child CIs', please read this KB article : "));


}

 

I need to display the error message along with the hyperlink of the KB article so that when i click on the KB number it redirects to the KB form. Below  is the example

"This application model still child CIs', please read this KB article :KB12345"

1 REPLY 1

Bhavana Reddy
Mega Guru

I am also looking for the similar solution, Please let me know if you were able to achieve ( g_for.showFieldMessage() doesnot support the link in the error message it self, another solution is using g_form.addInfoMessage() we can show the KB article link along with the message but this message is shown on top of the form that is the drawback)