gs.getDisplayValue() should show the value in English
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2024 04:31 AM
Hi Team,
We have a requirement in a Record Producer where there are choices for a select box fields which are translated to user's session Language. And we have been using a script to populate the short description using those choices .
Our requirement is that the choices should be in Translated Language(source user's language) but The short description shouldn't be Translated. It should be in English.
I have been using the below script but it doesn't work.
I have been trying below script , but the value of the producer short description is still in session language . Could you please help .
var lang = gs.getSession().getLanguage();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2024 04:53 AM
Hello @Uttam Sai ,
You can try by using this code in your script :
var lang = gs.getSession().getLanguage();
if (producer.problem_subcategory_team_center.getDisplayValue() == 'OTP') {
gs.getSession().setLanguage("en");
current.short_desc = producer.product_line.getDisplayValue() + ' - ' + producer.issue_category.getDisplayValue();
gs.getSession().setLanguage(lang);
} else {
current.short_desc = producer.problem_short_description;
}
If this will helps you please mark helpful as well as accept as solution.
Thanks & Regards,
Sayali Gurav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2024 04:57 AM
Hi @Sayali Gurav ,
This looks like the same one that i have mentioned in the question. Could you please help me understand , where i am doing wrong.
Thanks
Uttam Sai
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2024 05:03 AM - edited 01-18-2024 04:34 AM
No it is not same, I have added current keyword before the field name in if/else block e.g.
current.short_desc = producer.problem_short_description;
Try by using this code, it will work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2024 02:37 PM
Hi @Uttam Sai,
Did you see my earlier response?
Another community member has nicely provided a solution found in the link below.
To help others (or for me to help you more directly), after checking the link below, please come back and mark this response correct by clicking on Accept as Solution and/or Helpful.
Thanks, Robbie