- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2022 10:58 AM
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.
Thank You
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2022 11:27 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2022 05:27 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2022 05:28 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2022 05:53 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2022 06:19 AM
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2022 06:26 AM
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?