Hello everyone! I am completely stuck and need som...
# suitescript
f
Hello everyone! I am completely stuck and need some guidance. I am trying to create a new instance of a custom record (via Suitelet), but set it to a different custom form. However, no matter what I try, it never sets it to the form I am expecting! I try two ways: within record.create function call
Copy code
rec = record.create( {
  type: 'customrecord_test',
  isDynamic: true,
  defaultValues: {
    customform: 4
  }
} );
setting the field
rec.setValue( 'customform', 4 );
After I set the value, I do a getValue, and I am able to printout the form I am expecting! I also notice that the form validation (i.e. mandatory fields unique to my form with ID #4) is taken into account, but when I navigate to my newly created record, my new form is not persisting!! Has anyone seen behaviour like this before?
s
defaultValues
is not a catch all, it's a pretty useless parameter and I just never use it since it does not work for everything. On your custom record, do you have
store form with record
checked?
f
no!!!! oh my goodness!
@Sandii I believe you just saved me, thank you so much!!!
confirmed: it is working now! i cannot thank you enough! I definitely learned something today