Does anyone know how to change the form that is lo...
# suitescript
k
Does anyone know how to change the form that is loaded using a script. This is what I want to do in a
beforeLoad
user event script, but it doesn't work.
Copy code
if(category == 3) {
  record.setValue({
    fieldId: 'customform',
    value: '105',
  });
} else {
  record.setValue({
    fieldId: 'customform',
    value: '167',
  });
}
b
form has already been chosen by the time of the beforeLoad
👍 1
you can redirect the user using N/redirect
k
Okay I'll try that
m
You could also do it in
pageInit
in a client script, but that'll force a refresh so I think the redirect is better UX. With the redirect, you should be able to add a
cf
parameter in the url for the custom form.