Tip: NetSuite Custom Records and Built-in Timestamp Date Information

Here is a quick NetSuite SuiteScript development tip that isn’t well documented.

When you create custom records in NetSuite, all the fields you recreate are well named — by you.  Hence you can reference these easily in your code because you named them.  However, what if you need to get to NetSuite’s built-in date timestamp information?

The date timestamp field names are as follows:

  1. Date Created: “created”
  2. Last Modified: “lastmodified”

Sample NetSuite Timestamp SuiteScript Code

Here is some sample code:
var custrec = "customrecord_btc_trx_request";
var id = 1543;
var custrecord = nlapiLoadRecord(custrec, id);

nlapiLogExecution('DEBUG', 'value of created ', custrecord.getFieldValue('created') );
nlapiLogExecution('DEBUG', 'value of lastmodified ', custrecord.getFieldValue('lastmodified') );

Summary

If you are considering enhancing your NetSuite account to improve your business operations and need help, contact us.

Be Sociable, Share!

Marty Zigman

Holding all three official certifications, Marty is regarded as the top NetSuite expert and leads a team of senior professionals at Prolecto Resources, Inc. He is a former Deloitte & Touche CPA and has held CTO roles. For over 30 years, Marty has produced leadership in ERP, CRM and eCommerce business systems. Contact Marty to set up a conversation.

More Posts - Website - Twitter - Facebook - LinkedIn - YouTube

| Tags: , , , , | Category: NetSuite, Technical | 2 Comments

2 thoughts on “Tip: NetSuite Custom Records and Built-in Timestamp Date Information

  1. Leon says:

    Hi Marty, I hope my message finds you well. Is it possible to add a custom field similar to file attachment ? So can the custom field be of type File ?
    Cheers,
    Leon

  2. Marty Zigman says:

    Hello Leon,

    Unfortunately, no from what I can see. The workaround may be to create a custom record and then link it to the file. This then requires scripting to effectively keep the logical relationship together. Less than ideal…

    Marty

Leave a Reply

Your email address will not be published. Required fields are marked *