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:
- Date Created: “created”
- Last Modified: “lastmodified”
Sample NetSuite Timestamp SuiteScript 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.
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
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