IntegriWorks

Missing a required argument: id — what it means and how to fix it

Missing a required argument: id: It is the human-readable form of SSS_MISSING_REQD_ARGUMENT for the id option. record.load needs both type and id; if id is omitted, null, or comes from an empty lookup, you get this. Pass a valid internal id, or use record.create for new records.

When you see this

  • record.load or record.transform fails with "Missing a required argument: id".
  • The id was meant to come from a search or lookup that returned nothing.
  • You are trying to load a record that does not exist yet (it has no internal id).

Causes

  • record.load was called without the id option, or with id set to undefined/null.
  • The id was sourced from a search/lookup that returned no rows, leaving it undefined.

Fix

Make sure id is a real internal id before you load.

  1. Pass both required options to record.load — type and id — with id as a number or numeric string.
    var rec = record.load({ type: record.Type.CUSTOMER, id: customerId });
  2. Guard any id that comes from a lookup: confirm the result is non-empty before loading, and handle the empty case explicitly.
    if (!results.length) { log.audit('no match', criteria); return; }
            var id = results[0].id;

Prevent it

  • Never load a record from an id you have not checked is present.
  • For brand-new records use record.create (no id), not record.load.

SuiteScript version note: Same behaviour in SuiteScript 2.0 and 2.1.

Frequently asked questions

Is this the same as SSS_MISSING_REQD_ARGUMENT?
Yes — it is the same underlying error, with the message naming the id argument specifically.

Last reviewed: by Wouter Nortje, CA