How to get popup (info message) on incident page

Yash38
Kilo Guru

Requirement is to include popup (info message) on create incident form in the case mobile phone number and business phone number are missing where we are asking the user depending upon the language of logged in user to maintain that contact data in the source system?

Info message to display : 

  • GER: Sind Sie interner-Mitarbeitender und wollen Ihre Kontaktdaten dauerhaft im System hinterlegen? Dann pflegen Sie diese einfach unter xyz.com (Daten zur Person --> Kontaktinformationen) ein.
  • EN: Are you an internal employee and want to permanently store your contact data in the system? Then simply enter them at xyz.com (Personal data --> Contact information).

 

On incident form we have 2 fields as mobile phone number and business phone number(Details in these fields gets auto populated from sys_user table),

we have an UI policy which makes mobile phone number field mandatory if both the above fields are empty and in that case we need to popup an info message using the scripting in the same UI Policy.

find_real_file.png

find_real_file.png

Thank You

1 ACCEPTED SOLUTION

SumanthDosapati
Mega Sage
Mega Sage

If you want to check current user language.

That is very simple. There is one shortcut for that. --> g_lang

alert(g_lang); // it will print en if english.

You can use that to add if condition. 

so your script will be :

if(g_lang == 'en')
{
g_form.addInfoMessage("Are you an internal employee and want to permanently store your contact data in the system? Then simply enter them at xyz.com Personal data --> Contact information.");
}
else if(g_lang == 'ger')
{
g_form.addInfoMessage("Sind Sie interner-Mitarbeitender und wollen Ihre Kontaktdaten dauerhaft im System hinterlegen? Dann pflegen Sie diese einfach unter xyz.com Daten zur Person --> Kontaktinformationen ein.");
}

 

Mark as correct and helpful if it solved your query.

Regards,
Sumanth

View solution in original post

19 REPLIES 19

SumanthDosapati
Mega Sage
Mega Sage

Hi,

In 'Execute if true' script, write as below

g_form.addInfoMessage("your message here");

 

Mark as correct and helpful if it solved your query.

Regards,
Sumanth

SumanthDosapati
Mega Sage
Mega Sage

If you want to check current user language.

That is very simple. There is one shortcut for that. --> g_lang

alert(g_lang); // it will print en if english.

You can use that to add if condition. 

so your script will be :

if(g_lang == 'en')
{
g_form.addInfoMessage("Are you an internal employee and want to permanently store your contact data in the system? Then simply enter them at xyz.com Personal data --> Contact information.");
}
else if(g_lang == 'ger')
{
g_form.addInfoMessage("Sind Sie interner-Mitarbeitender und wollen Ihre Kontaktdaten dauerhaft im System hinterlegen? Dann pflegen Sie diese einfach unter xyz.com Daten zur Person --> Kontaktinformationen ein.");
}

 

Mark as correct and helpful if it solved your query.

Regards,
Sumanth

Hi SUMANTH,

Im getting the popup but in all the cases even if any of the phone number is present.

Hi,

Can you share your ui policy condition screenshot