module function · N/file
load()
file.load(options)
Loads an existing file.File from the NetSuite File Cabinet.
- Implementation
- Implemented in the compiler, not yet published
- Design
- Accepted
load File(id)
1file.load({2 id: /* number | string, required */3});
| Parameter | Type | Required | Description |
|---|---|---|---|
| options.id | number | string | required | The identifier of a file in the File Cabinet. To specify a file in the File Cabinet, you can pass one of the following as the value of this parameter: The internal ID of the file as a number or string The absolute file path to the file in the File Cabinet (for example, 'Images/myImageFile.jpg' ) The relative file path to the file in the File Cabinet (for example, './Images/myImageFile.jpg' to specify a file path relative to the current folder of your script, or '../Images/myImageFile.jpg' to specify a file path relative to the parent folder of your script) To find the internal ID of the file in the UI, select Documents > Files > File Cabinet . |
Supported syntax · compiles today
let file = load File(456)
1const file = file$.load({2 id: 4563});
File is opaque so far: it can be loaded and held, but its contents and properties are not modeled yet, and it cannot be a function parameter. The module is bound as file$ so a local can be called file. In the compiler, not yet published: npm 0.1.0 does not have it. Verified with mynt build on 13 Oct 2026.
Competing syntax for load, from GitHub Discussions. Select two or more to compare them side by side, with the syntax Mynt supports today as a baseline.
let file = load File(456)Loading proposals from GitHub…
Write the Mynt you wish you could write.
A good proposal shows the syntax, the SuiteScript it should become, and argues for it: why it is clearer, how it fits the rest of the language, what it makes harder.
- Clarity. Does it say what happens, without ceremony?
- Consistency. Does it read like
load,saveandRef[field]? - Expressiveness. Does it cover the cases people actually write?
- Honesty. Does it hide a NetSuite cost, such as governance, that a reader should see?