- 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 06:30 AM
From Sys_user table

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2022 07:01 AM
I mean did you write a client script to populate them?
If yes, in the same client script you can add conditions and make mandatory and show field message.
In that case you can deactivate your ui policy.
Regards,
Sumanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2022 07:18 AM
No i didnt write client script to populate data.
In variable we have a field call default value there i have written script like this :
javascript: gs.getUser().u_mobile_phone
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2022 10:25 AM
I'm going to have to highlight here, please don't code like this as it's a "hard-coded string" which is not good practice. I have blogged about this very topic in the past (here),
To learn more about the MessageAPI please review our Language Guide (here),
Many thanks,
Kind regards
Director of Globalization Deployment, Internationalization
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2022 09:52 PM
My intention here is not to hardcode. I knew that isn't best practice.
Here I just wanted to provide him the logic to complete his business requirement.
Anyways thanks for your article. That's a good one!!