RE: Error – You cannot create an inventory detail for this item. – Creating Item Fulfillment.

I have a requirement to automate the Mark Shipped button displays in the net suite purchase order form.

Mark Shipped button in the creates Item Fulfillment. I have created below code for creating item fulfillment.

           

InitializeRecord iRecord = new InitializeRecord();
iRecord.type = InitializeType.itemFulfillment;
InitializeRef iRef = new InitializeRef();
iRef.typeSpecified = true;
iRef.type = InitializeRefType.salesOrder;
iRef.internalId = soInternalID;
iRecord.reference = iRef;
ReadResponse getInitializeResponse = Service.initialize(iRecord);
if (getInitializeResponse.status.isSuccess != true) throw new Exception(getInitializeResponse.status.statusDetail[0].message);
ItemFulfillment iFulfillment = (ItemFulfillment)getInitializeResponse.record;
ItemFulfillmentItemList iFulfillmentItemList = iFulfillment.itemList;
List<ItemFulfillmentItem> iFulfillmentItems = new List<ItemFulfillmentItem>();
////string binNumberInternalId = getBins(iFulfillment.itemList.item[0].item.name);
InventoryAssignment iAssignment = new InventoryAssignment
{ binNumber = new RecordRef { internalId = “3”, type = RecordType.bin, typeSpecified = true },
quantity = 1,
quantitySpecified = true };
List<InventoryAssignment> iAssignmentList = new List<InventoryAssignment>();
iAssignmentList.Add(iAssignment);
iFulfillmentItemList.item[0].inventoryDetail = new InventoryDetail
{ inventoryAssignmentList = new InventoryAssignmentList
{ inventoryAssignment = iAssignmentList.ToArray()
} };
iFulfillmentItemList.item[0].quantity = 1;
ItemFulfillmentItemList iFulfillmentItemNewList = new ItemFulfillmentItemList();
iFulfillmentItemNewList.replaceAll = false;
iFulfillmentItemNewList.item = iFulfillmentItemList.item.ToArray();
ItemFulfillment newItemFulfillment = new ItemFulfillment();
newItemFulfillment.createdFrom = new RecordRef { internalId = soInternalID, type = RecordType.salesOrder, typeSpecified = true };
newItemFulfillment.entity = new RecordRef { internalId = “XXXXXX”, type = RecordType.customer, typeSpecified = true };
newItemFulfillment.shipMethod = new RecordRef { internalId = “XXXXXX”, name = “Standard” };
newItemFulfillment.shippingCost = Convert.ToDouble(“5”);
newItemFulfillment.shipStatus = ItemFulfillmentShipStatus._shipped;
newItemFulfillment.shipStatusSpecified = true;
oCustomFieldRefList = new List<CustomFieldRef>();
StringCustomFieldRef objStringCustomFieldRef = new StringCustomFieldRef();
objStringCustomFieldRef.scriptId = “custbody4”;
objStringCustomFieldRef.value = “eBay US”;
oCustomFieldRefList.Add(objStringCustomFieldRef);
objStringCustomFieldRef = new StringCustomFieldRef();
objStringCustomFieldRef.scriptId = “custbody1”;
objStringCustomFieldRef.value = “22-05005-77941”;
oCustomFieldRefList.Add(objStringCustomFieldRef);
objStringCustomFieldRef = new StringCustomFieldRef();
objStringCustomFieldRef.scriptId = “custbody16”;
objStringCustomFieldRef.value = “192940280928”;
oCustomFieldRefList.Add(objStringCustomFieldRef);
newItemFulfillment.customFieldList = oCustomFieldRefList.ToArray();
newItemFulfillment.itemList = iFulfillmentItemNewList;
ItemFulfillmentPackageList itemPackageList = new ItemFulfillmentPackageList();
ItemFulfillmentPackage[] itemPackages = new ItemFulfillmentPackage[1];
ItemFulfillmentPackage iPackage = new ItemFulfillmentPackage();
iPackage.packageTrackingNumber = “1”;
iPackage.packageWeight = Convert.ToDouble(“0.01”);
iPackage.packageWeightSpecified = true;
itemPackages[0] = iPackage;
itemPackageList.package = itemPackages;
newItemFulfillment.packageList = itemPackageList;
WriteResponse response = Service.add(newItemFulfillment);
if (response.status.isSuccess != true) throw new Exception(response.status.statusDetail[0].message);

When i executing this code i am getting You cannot create an inventory detail for this item. error. when i  provide specified BIN NUMBER (for ex. 5117. Here i have provided BIN NUMBER as 3) then i am able to create item fulfillment.

Client is requesting us not to use the BIN NUMBER on creating item fulfillment.  Also when i create item fulfillment throw net suite website (not throw code) by clicking the Mark Shipped button in the purchase order form, its not asking us to provide inventory detail and was able to create item fulfillment without providing BIN NUMBER.

Please help  me to fix this issue.

Thanks in Advance.

 

 

 

arulmani_m Rookie Asked on May 20, 2020 in SuiteTalk.
Add Comment
1 Answers

This error usually means your script is trying to create Inventory Detail on a line that doesn’t support it or is missing the required bin/lot/serial information.

For an Item Fulfillment, check:

  1. Item type — confirm the item requires inventory detail (bin-managed, lot-numbered, or serialized).
  2. Location — make sure the fulfillment location matches the item’s inventory/location setup.
  3. Bin/Lot/Serial — if required, populate the inventorydetail subrecord with the correct bin, lot, or serial number and quantity. NetSuite requires serial/lot details when fulfilling those items.
  4. Don’t create inventorydetail for ordinary items — NetSuite will throw this exact error if the line doesn’t support an inventory-detail subrecord.
  5. For bins, verify the bin actually has sufficient available quantity at the fulfillment location.

If you’re using SuiteScript/SuiteTalk, the key is to only access/create the Inventory Detail subrecord when the item requires it, then populate the appropriate binNumber, issueInventoryNumber/lot or serial number, and quantity. The Inventory Detail record is a subrecord of the parent transaction.

In short: Don’t blindly create Inventory Detail on every fulfillment line. First determine whether that item/location requires bin, lot, or serial tracking; then supply the correct inventory assignment.

Rookie Answered on August 19, 2026.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.