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

Yes, here it is!

find_real_file.png

find_real_file.png

1) In your ui policy condition, you gave AND in between two conditions. So, it will show error message only if both the fields are empty.

2) In 'execute if false' add below line

g_form.clearMessages();

 

 

Mark as correct and helpful if it solved your query.

Regards,
Sumanth

 

now what is happening, for false condition " 

infomessage is getting displayed and within fraction of second it is getting cleared.

it should not go to the 1st script(true condition) at all and the infomessage should not be displayed even for a fraction of second

 

That may be because your value is getting populated after the UI policy is runs.

Can you tell from where the value is getting populated?