Service Portal - set value of field in record producer

vzvinny
Kilo Explorer

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

11 REPLIES 11

scottl
Kilo Sage

Target the form and the input from your widget controller like this.


$scope.page.g_form.setValue('variable', 'some text');            


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)


Actually I now believe this is due to an issue (PRB712487) that will be fixed in Helsinki patch 6.


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);