Reputation: 117
I created one suitelet with form. I called this values in other suitelet (I created form in this suitelet as well.) I wanted to print some values in this suitelet that I get but unable to do so.
Snippet of the Code:
var name = form.addField('r_name',"text","NAME");
name.setDisplaySize(500,50);
name.setFieldValue("r_name",name1);
I get the value in log execution for name1. I can see the field on the suitelet page but I cannot see the value set for that field.
Upvotes: 0
Views: 929
Reputation: 577
You can not pass setDefaultValue(Val) two Params. It only takes one param, the obj you are calling it on is the field you want to set the value for.
fieldHandle.setDefaultValue('my value');
Upvotes: 1
Reputation: 8847
In Suitelet forms, when you want to set the value of a field on the server-side (i.e. in the Suitelet code itself), you need to use field.setDefaultValue
instead of field.setFieldValue
.
Upvotes: 3