How to display an Info message in ServiceNow Portal

Priya131
Kilo Contributor

Hi,

How to display an info message for the service Now Portal when the incident form resolved state changes to the closed state.

Regards,

Priya

20 REPLIES 20

Hi,

Can you confirm, do you want to display an info message when the user change the resolved to closed - if yes above business rule should work.

Or if you want to display the info message for already closed incidents - Create an onLoad client script and set the UI type as Mobile/service portal.

function onLoad() {
    //Type appropriate comment here, and begin script below

    if (g_form.getValue('state') == 7) { // set the correct closed state value

        g_form.addInfoMessage('The incident state is already closed');

    }

}

Hi Balaji,

Yes, I want to display an info message for already closed incidents in the service portal.

I have tried the onload client script as well, it was not working, Please help me on this issue.

find_real_file.png

 

Regards,

Priya

Hi,

did you check the state field is present on form

try this

if(g_form.getValue('state').toString() == '7'){

 

}

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Hi,

I have tried, It's not working.

 

 

Hi,

which form/page you are checking this?

Did you check the onLoad is running? try adding alert and check

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader