IntegriWorks

SSS_MISSING_REQD_ARGUMENT — what it means and how to fix it

SSS_MISSING_REQD_ARGUMENT: It means a SuiteScript 2.x API call ran without a required argument — usually a missing or misspelled option such as type or id, or a value that resolved to undefined. Read the error message for the argument name, then pass the correct options object with exact, case-sensitive keys.

When you see this

  • A SuiteScript 2.x script fails and the execution log shows "SSS_MISSING_REQD_ARGUMENT".
  • The failing line calls an N/ module API such as record.load, record.create, record.transform, or search.lookupFields.
  • Often right after a deployment — a script parameter the code relies on was never populated, so its value is undefined.

Causes

  • A required option is not passed at all — e.g. record.load called without the type or id option.
  • An option name is misspelled or wrong case, so the required key is effectively missing — e.g. recordType instead of type, or Id instead of id (SuiteScript keys are case-sensitive).
  • A required value resolves to undefined or null upstream — a script parameter not set on the deployment, an empty search result, or a variable assigned conditionally and never reached.
  • Arguments passed positionally instead of as a single options object, which the SuiteScript 2.x API expects.

Fix

Work from the error message outward — it names the missing argument and the API that needed it.

  1. Open the execution log (or the script deployment's audit trail) and read the full message. SSS_MISSING_REQD_ARGUMENT names the specific argument that was missing and the API that required it.
  2. Confirm you are passing a single options object with the exact required keys for that API. For record.load the required keys are type and id:
    var so = record.load({
              type: record.Type.SALES_ORDER,
              id: 12345,
              isDynamic: false
            });
  3. Log the arguments immediately before the call to catch undefined values. If a value is undefined, fix where it is set rather than at the call site.
    log.debug({ title: 'load args', details: { type: t, id: id } });
            if (!id) throw error.create({ name: 'MISSING_ID', message: 'id was not provided' });
  4. If the value comes from a script parameter (runtime.getCurrentScript().getParameter), verify the parameter is added to the script record AND populated on the deployment record — an unset parameter returns null.
  5. Check the property names against the SuiteScript 2.x API reference exactly (type, id, fromType, fromId, isDynamic). A misspelled key leaves the required option missing.

Prevent it

  • Validate required inputs at the top of every entry point and throw a clear, named error if one is missing — fail loudly, not deep inside an API call.
  • Use the record.Type enum constants instead of string literals so a typo is caught at author time.
  • Cover the script with the SuiteScript debugger before deploying, and confirm every script parameter is set on the deployment, not just the script record.

SuiteScript version note: Applies to both SuiteScript 2.0 and 2.1 — the N/ module signatures are the same; 2.1 only adds ES2019 language features. The error is module-agnostic: any N/ API that declares a required argument can raise it.

Frequently asked questions

Does SSS_MISSING_REQD_ARGUMENT mean the record does not exist?
No. It is raised before any record lookup, because an argument to the API call was missing or undefined. A record that genuinely does not exist raises a different error (RCRD_DSNT_EXIST).
How do I know which argument is missing?
The full error message in the execution log names the missing argument and the API that required it. Start there rather than guessing.
Can a misspelled option really cause this?
Yes. SuiteScript option keys are case-sensitive, so passing recordType instead of type leaves the required type option undefined and triggers the error.

Last reviewed: by Wouter Nortje, CA