getOption always return null
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-14-2016 08:32 AM
Hi all,
I have a problem for getting value of a choice list, in a client script.
In a form, I have a field, type choice, with any specified choices. Its name is u_quotation_type.
In a client script, I try to get dynamically the display value of an option.
For this, I'm trying to use g_form.getOption, and then get its innerText property.
And there, is the problem : my getOption always return null..
Below my (simple) code :
alert( g_form.getValue('u_quotation_type')); // Displays "option"
alert(g_form.getOption("u_quotation_type", 'option')); // Displays null
alert(g_form.getOption("u_quotation_type", 'Option')); // Displays null
alert(g_form.getOption("u_quotation_type", g_form.getValue('u_quotation_type'))); // Displays null
I'm working on a Helsinki instance.
Can anyone give me help, please ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-15-2016 04:55 AM
Yes you could also use it in Onload client script, no problem in it. I will check in my dev instance and I will let you know the right code.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-15-2016 04:59 AM
Thanks Harish !
Could you test it on a Helsinki instance ? Maybe it was working in previous versions of SNOW..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-15-2016 05:21 AM
You can use it on client script
var quotationValue = g_form.getValue(u_quotation_type);
var displayValue= g_form.getOption(u_quotation_type, quotationValue).text;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-16-2016 01:16 AM
Hi all,
So, I've resolved my issue : the field was ReadOnly (ACL and dictionnary).
If ReadOnly, the getOption method doesn't work (this is not really nice, but that's it ^^)
Thanks to all for your help.