Add new comment

We have a sales order with an Item Fulfillment record. Trying to create a second Item Fulfillment record on the same Sales Order causes the following error:

ERROR: INVALID_INITIALIZE_REF
Message: You have an invalid sales order 18506 or the order is already closed.

Do you not recommend creating multiple Item Fulfillment record off of a single Sales Order?

Here is the code snippet used to insert a new Item Fulfillment record with SuiteTalk.

$myNSclient->setPreferences(true, false, false, false, true, true);
$id = $this->getSalesOrderInternalId();

// Packaging Information
$packageFields = array (
		'packageWeight' => $data['packageWeight'],
		'packageDescr' => $data['packageDescr'],
		'packageTrackingNumber' => $data['packageTrackingNumber']
);
$package = new nsComplexObject('ItemFulfillmentPackage');
$package->setFields($packageFields);

$packageListFields = array ('package' => $package );
$packageList = new nsComplexObject('ItemFulfillmentPackageList');
$packageList->setFields($packageListFields);

//Record
$itemFulfillment = new nsComplexObject('ItemFulfillment');
$fulfillmentFields = array (
		'createdFrom'     =>    new nsRecordRef (
				array('internalId'=>$id, 'type' =>'salesOrder' )),
		'packageList'     =>    $packageList
);

$itemFulfillment->setFields($fulfillmentFields);
$response = $myNSclient->add($itemFulfillment);
By aladar

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.