Hello everyone, do you know if it's possible to ad...
# suitescript
l
Hello everyone, do you know if it's possible to add/remove field on click of a button in NetSuite, without using jQuery? I need to allow user to add new text field if they need more than one
w
If you predefine a couple of fields in the recordsetup, you can hide/show them with a client-script. Or perhaps create a bunch of custpage_fields in a UE and then show/hide with client-script.
l
Hm, but that still would be manipulating UI with jQuery which I'm trying to avoid whenever possible (unless you meant changing display type, which I think could work)
w
I meant changing display type.
👍 1
b
Copy code
field.isDisplay = false;
from the documentation 😉 @Lukasz Formela
👍 1
l
isn't isDisplay read-only though?
b
not according to doc:
// Add additional code. define(['N/currentRecord'], function(currentRecord) {return {pageInit: function(context) { var record = currentRecord.get(); var field = record.getField({fieldId:"custbody1"}); field.isDisplay = false; ... // Add additional code.