I don't suppose anyone's got a nice conversion lib...
# suitescript
a
I don't suppose anyone's got a nice conversion library that reduces the amount of pure boilerplate? Something that would turn
Copy code
var foo = context.currentRecord.getValue({fieldId:'bar'});
into something more like, say...
Copy code
var foo = $().bar;
for example, if your current record is a customer,
Copy code
const c = new Customer(context.currentRecord)
c.bar
a
Beautiful! Thanks!
s
I dislike the NS boilerplate, especially complex functions for what should be simple property access on objects. NFT makes basically all netsuite data access into natural object.property access.
that consistency becomes impressive when you consider an example of 'get the city of the first address on the customer'
Copy code
const c = Customer(context.currentRecord)
c.addressbook[0].addressbookaddress.city
the above is not only intuitive but also strongly typed. the alternative in normal SuiteScript makes my eyes hurt.