Articles in this section

Troubleshoot NetSuite error: invalid_initialize_ref

A NetSuite import that creates a record from another transaction, such as an invoice from a sales order or an item receipt from a purchase order, fails with invalid_initialize_ref when NetSuite won't create the new record from that source transaction in its current state. This article explains what the error means, how to find the cause from the source transaction's status, and how to resolve each cause. It applies to any flow that imports into NetSuite, including templates and integration apps.

What the error means

Symptom: A NetSuite import fails with this error:

Failed to create, update/transform record because You can not initialize <record type>: invalid reference <id>

For an item fulfillment or a cash sale created from a sales order, the message reads You have an invalid sales order <id> or the order is already closed.

The import creates the new record from a source transaction. The mapping's Created From value holds the internal ID of that source transaction, and that's the ID in the message. The source transaction exists, but NetSuite won't create this record from it in its current state. To find the cause, open the source transaction in NetSuite and check its status against the sections below.

The source transaction is already fully processed

Symptom: The source transaction has one of these statuses:

Record the import createsSource transactionStatus
Item receiptPurchase orderPending Bill, Fully Billed, or Closed
Item receiptTransfer orderReceived
Item receiptReturn authorizationPending Refund, Refunded, or Closed
Item fulfillmentSales orderPending Billing, Billed, or Closed
InvoiceSales orderBilled or Closed

Cause: Nothing is left on the source transaction to receive, fulfill, or bill. The record usually already exists, for example because the same request was sent again.

Resolution:

  1. In NetSuite, find the record that was already created from the source transaction, and compare it with the failed record.
  2. If the existing record is correct, resolve the error in integrator.io. Retrying the error fails the same way.

The source transaction isn't approved or ready

Symptom: The source transaction has one of these statuses:

Record the import createsSource transactionStatus
Item receiptPurchase orderPending Supervisor Approval or Rejected
Item receiptTransfer orderPending Approval or Pending Fulfillment
Item receiptReturn authorizationPending Approval
Item fulfillmentSales orderPending Approval
InvoiceSales orderPending Approval or Pending Fulfillment

Cause: The source transaction must be approved first, or an earlier step, such as fulfilling or shipping it, hasn't happened yet.

Resolution:

  1. In NetSuite, approve the source transaction, or complete the earlier step, such as fulfilling or shipping it.
  2. Retry the error in integrator.io.

The purchase order is a drop shipment

Symptom: An item receipt created from a purchase order fails, even though the purchase order's status is Pending Receipt.

Cause: The purchase order's lines are drop-shipped. NetSuite doesn't create item receipts from drop-ship purchase orders.

Resolution: Resolve the error in integrator.io. Don't send an item receipt for this purchase order. Retrying the error doesn't help.

Errors that look similar

These errors also appear when a NetSuite import creates a record from another transaction, but they have different causes:

  • That type of record transformation is not allowed: NetSuite doesn't create the record type the import sends from this type of source transaction.
  • Invalid transaction # <id>: No transaction in NetSuite has the internal ID the import sent.

Related articles