This article is relevant if you are working to develop a software product that will be bundled for distribution to other NetSuite accounts and / or through the SuiteApp network.
Server Referencing to Images and Binary Content
When working with NetSuite’s document file system, you are able to store binary files (e.g., images, documents) and then reference them via a proprietary URL. In addition, you can throw a switch to allow your binary file to be “Available without Login”. This basically exposes the content to anyone on the internet.
A challenge may present itself if the SuiteScript code you are developing needs to reference that content. For example, you may want to build email templates that reference your content. The email template content structure do not support script. So you are effectively forced to hard code the server reference to get to your binary data.
NetSuite supports multiple server environment infrastructures and the URL will be different as your software bundle is distributed to other NetSuite Accounts.
NetSuite Production Binary Content Reference
Some of our objects had references to binary content with server names such as https://system.na1.netsuite.com. We noticed that our SuiteApp bundles required “extra configuration” after running our SuiteBundler installation because when the code was distributed to other accounts, the server names was now https://system.netsuite.com.
While not documented, you can reference your images and binary content with the following url:
https://content.netsuite.com
It appears that NetSuite is offering a proxy service at https://content.netsuite.com which will resolve the correct server infrastructure so you don’t have to worry about this concern.
For example, these two URLs point to the same image content.
https://content.netsuite.com/core/media/media.nl?id=4&c=840889&h=6ab1958d501e190de097
https://system.netsuite.com/core/media/media.nl?id=4&c=840889&h=6ab1958d501e190de097
Getting Help Developing SuiteScripts and SuiteBundles
If you want to enhance your NetSuite account or develop products for the NetSuite platform, contact us.