Hi there 👋

Welcome!

Suitescript Reference File Without Domain

How do you reference images that are stored in your Filing Cabinet when trying to embed them into HTML. For example, when using logos in your emails how do you reference them? When constructing emails that are used within SuiteScript you would think you’d need to construct the emails with both the url of the file AND the domain of your Netsuite instance, perhaps coded like this: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 import url = require("N/url"); import file = require("N/file"); const fn () => { const fileId = 0; const domain = url.resolveDomain({ hostType: url.HostType.APPLICATION }); const imgFile = file.load({ id: fileId }); // construction of the full URL for use outside Netsuite, right? const imgUrl = `${domain}${imgFile.url}`; return `<img src="${imgUrl}">`; } However, the result from this function is https://0000.app.netsuite.comhttps://0000.app.netsuite.com/yourFileLocation ...

May 2, 2025 · 1 min · 206 words · Ryan Sheehy

Suitescript Object Script Deployment Recurrence

When creating an XML object definition for your Suitescript deployment I noticed the schedule for the deployment was different to what I had coded. Here’s a snippet of the XML object definition for a script where I wanted the script to run monthly, on the first day of the month at midnight: 1 2 3 4 5 6 7 8 9 <status>SCHEDULED</status> <recurrence> <monthly> <startdate>2024-12-02</startdate> <starttime>00:00:00Z</starttime> <dayofmonth>1</dayofmonth> <everyxmonths>1</everyxmonths> </monthly> </recurrence> As you see it has all the necessary definitions. ...

May 2, 2025 · 1 min · 174 words · Ryan Sheehy

SuiteQL Improve Budget Query With CTE

I recently ran a budget SuiteQL query that took a whopping 527,138ms to complete (that’s nearly 9 minutes!). I had to take a look and see why it was taking so long, and after a few tweaks found the issue had to do with trying to find the very budget category I needed. So to assist in this discovery I modified my query to search for the budget category first before using it in the rest of my statement. ...

May 2, 2025 · 4 min · 848 words · Ryan Sheehy