Hi All I created a beforeLoad userevent script whi...
# suitescript
a
Hi All I created a beforeLoad userevent script which I added select field type and I called a fieldChanged client script that push list of data to this field the above scenario goes well but after I saved the record the data in this field didn't saved, any advice ?
c
Are you saying that you are just adding the select field to the form, and that you haven't created a custom record field on the actual record to store the data?
a
@CD I added select field to custom invoice form with suitescript using beforeLoad userevent script and then called a fieldChanged client script and push data to this field to choose from these choices, after saving the invoice it cannot save/store data in this field
c
You need to create a custom field on the transaction to store the data in
I don't know why you have just cross-posted to #C298P0BCK too
a
@CD I already create this field as below form.addField({                 id: 'custpage_bank_name',                 label: 'Bank Name',                 type: serverWidget.FieldType.SELECT,             });
c
No. Custom fields on transactions are different. The form field you have created does not persist, as you have discovered, it has only created something on the form. You also need to create a custom field to save the data to. Documentation for custom fields is here: https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/chapter_N2826978.html
I do understand the confusion. The documentation on
N/ui/serverWidget
should make this more explicit, but it doesn't from what I can see
Also, you may not need to use your beforeload etc any more once you have created the custom field (if it's a dropdown list)
a
@CD Ok, now are you have any advice to solve this issue ?
b
the primary advice was already given, create a custom field using suitebuilder and store the value in that field
a
@CD @battk Thank you for both, I did it