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.
New AI Community Guidelines. Please review and follow them to ensure AI use stays safe, accurate, and compliant.
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