g_form.getOptions not working in the portal. alternative
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2016 05:09 AM
Hi all,
With the new service portal g_form.getOptions is not working and using g_form.getValue will return the value and not the display value which is a string.
GetOption is not handle by the portal
Has anyone an idea or alterntive?
Regs,
Lô Mouhamadou

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2016 05:14 AM
Use an $http request to do a REST call in your widget to get the options from the sys_choice table.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2016 06:33 AM
I'm assuming you're using a catalog client script on a catalog item or record producer here. I believe that Service Portal only supports methods that are mobile friendly in client scripts, so you might have to use either getReference() with a callback or a GlideAjax call here. What exactly do you need the display value for here, maybe there's another way you can go about accomplishing your requeirement.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2016 07:00 AM
Hi Brad,
It is on record producer on HR case table.
The thing is after user completed the whole form, I generate a PDF already filled in with the value that user just added.
I have some fields that are select boxes and getvalue return 1 or 2 or 3 etc...; but I need to get the related text and put it in the pdf.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2016 07:09 AM
So you're running an onSubmit client script that generates the PDF? In that case I think you might end up needing another step. Maybe from your record producer script you could redirect the user to a ui page where you pass the display values of all of those fields from the server side RP processing script and generate the pdf from there.