Service Portal - set value of field in record producer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2016 06:25 PM
Hey,
I'm trying to set the value of an input field in a record producer from the Service Portal widget's client or server script.
I have no problems using functions like g_form.setValue() on normal catalog items, but I'm lost with how to manipulate anything in a record producer.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2016 09:19 PM
Target the form and the input from your widget controller like this.
$scope.page.g_form.setValue('variable', 'some text');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-21-2016 03:30 PM
I'm still having the same issue.
The error I'm receiving when trying to hit the variable is "TypeError: Cannot read property 'setValue' of undefined"
My input ID is structured as "sp_formfield_IO:123456" so I'm wondering if the format is why I can't successfully select it.
(I've also tried targetting it by the variable name)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-21-2016 04:07 PM
Actually I now believe this is due to an issue (PRB712487) that will be fixed in Helsinki patch 6.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-21-2016 04:58 PM
What Patch are you on, as I'm on Patch 5 and setValue() works fine. That issue PRB712487 is related to not being able to clear the field with an empty string. That however can be overcome with
g_form.setValue('variable', null);