- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2017 02:32 AM
Hi
I am trying to create a new system ui message with dynamic argument which needs to be translated
Here I am sharing how it's configured
alert(getMessage('Additional company'+i+'details' must be entered'));
and have created entry in ui messages table - with key 'Additional company'+i+'details' must be entered' in English and French values. But alert is not getting values from message table.
Please help.
Thanks,
Kiran
Solved! Go to Solution.
- Labels:
-
User Interface (UI)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2017 02:56 AM
Hi,
Here is how dynamic variables can be passed to messages
Single Parameter passing, Message sample "Incident {0} is created"
var msg = gs.getMessage('Incident {0} is created', current.number); // This is how you replace variable
Multiple parameter passing, Message sample "Incident {0} is updated to State: {1}"
var arr = [];
arr.push(current.number);
arr.push(current.state);
var msg = gs.getMessage('Incident {0} is updated to State: {1}', arr);
In your case. The message should be, "Additional company {0} details must be entered" and you should replace this in your code
gs.getMessage('Additional company {0} details must be entered', i );
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2017 03:29 AM
Can you add a space in your message next to {0}
Additional company {0}
Thanks
PS: Hit like, Helpful or Correct depending on the impact of the response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2017 03:35 AM
same result: Additional company {0}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2017 03:43 AM
Dynamic variable assignment wont work for messages on client side scripts. It is only available to server side scripts (gs.getMessage)
Thanks
PS: Hit like, Helpful or Correct depending on the impact of the response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2017 03:33 AM
I checked the documentation for getMessage. Since you are using this on a client side script it wont accept a second paramater. It will only work on server side scripts
getMessage(String) on client side uses only one parameter vs gs.getMessage(String, Object) that can use a second parameter.
Thanks
PS: Hit like, Helpful or Correct depending on the impact of the response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2017 03:57 AM
but I can see few OOB client scripts with gs.getMessage(String, Object).