TO show field message

Niyeeti Dey1
Tera Contributor

Hi Everyone,

 

I have a requirement where I need to show the field message based on field value changes but the message contain a link which not possible in field message but client wants below that field only is there any alternate way to achieve the requirement. My link is too long that's why even the link is not appearing inside the blue box due to split in the form.  I can't use addInfoMessage

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
    if (isLoading || newValue === '') {
        return;
    }
    var msg = "You have to contact Export Control(https://example.com)";
    var data = g_form.getValue('u_exp_control');
    if (data == 'true') {
      g_form.showFieldMsg('u_exp_control',msg);
    } else {
        g_form.clearMessages('u_exp_control');
    }

 

2 REPLIES 2

Arpan Baishya
Kilo Sage

Hi @Niyeeti Dey1,

 

Sorry for seeing this late. Could you please try what has been suggested in this link in your Client Script and use it for showFieldMsg()?


Let me know if this helps you.

Vishal Birajdar
Giga Sage

Hello @Niyeeti Dey1 

 

In case , your use case is on Catalog item :- 

You can use "Rich text label" variable , add your link in that label and show/hide that variable depending upon your condition.

Put the order of that variable below that field.

 

For Native UI , You have to use addInfoMessage(), link will not work for showFieldMsg()

 

 

 

Vishal Birajdar
ServiceNow Developer

I know one thing, and that is that I know nothing.
- Socrates