Discussions
Stay up-to-date with the latest news from NetSuite. You’ll be in the know about how to connect with peers and take your business to new heights at our virtual, in-person, on demand events, and much more.
Now is the time to ask your NetSuite-savvy friends and colleagues to join the NetSuite Support Community! Refer now! Click here to watch and learn more!
Stay in the Know
Be sure you're subscribed to NetSuite communication to stay in the know about monthly happenings, updates and announcements. Subscribe
Be sure you're subscribed to NetSuite communication to stay in the know about monthly happenings, updates and announcements. Subscribe
Extending the nlobjRecord object
Hi everyone,
While working on an optimization, I was wondering about extending the nlobjRecord object with additional functions. For instance, suppose we look at the Transaction record, which would look something like this:
// extend the nlobjRecord definition nlobjRecord.prototype.isTransactionNew = function(){ if( this.trandate > (new Date() - 30) ) { return true; } else { return false; } } // create an object to play around with var transaction = nlapiLoadRecord("transaction", 1234); // use the new function if(transaction.isTransactionNew()) { ...do things... } As far as I can tell, this extension works and I'm considering creating some libraries for custom records. Now my questions are: [LIST=1]
[*]Have any of you extended your class/object definitions?
0