1

I am creating an Inventory Adjustment record through my Suitelet. While creating Inv Adj with a Lot Numbered Inventory Item, the system throws the following error:

"code\":\"INVALID_KEY_OR_REF\",\"details\":\"Invalid binnumber reference key 151 for issueinventorynumber 188.\"

My Code:

function createInvDetailsInLines(transactionRec, itemobj, qtySetByUser, binnumb) {
  for (var key in itemobj) {
    var inData = itemobj[key];
    for (var i = 0; i < inData.length; i++) {
      var invtDetailSubRec = transactionRec.createCurrentLineItemSubrecord('inventory', 'inventorydetail');
      invtDetailSubRec.selectNewLineItem('inventoryassignment');
      invtDetailSubRec.setCurrentLineItemValue('inventoryassignment', 'status', inData[i].status || 1)
      invtDetailSubRec.setCurrentLineItemValue('inventoryassignment', 'quantity', qtySetByUser)
      invtDetailSubRec.setCurrentLineItemValue('inventoryassignment', 'receiptinventorynumber', inData[i].invNum)
      invtDetailSubRec.setCurrentLineItemValue('inventoryassignment', 'binnumber', binnumb)
      //invtDetailSubRec.setCurrentLineItemValue('inventoryassignment', 'issueinventorynumber', inData[i].invNum)
      invtDetailSubRec.commitLineItem('inventoryassignment');
      invtDetailSubRec.commit();
    }
  }
}

Can anyone advise me what can be the cause of this error?

4N335
  • 267
  • 2
  • 29

2 Answers2

0

It is because the bin number (id: 151) is not of the specific location of the inventory number(id: 188)

4N335
  • 267
  • 2
  • 29
0

If you try to import the data to Netsuite you need the Bin id (Internal id ) to post the information to Invnetory Adjustment Transaction. I guess you already import the bin ids to Netsuite or find the Internal ids for Bins. Otherwise, first you need to import all bin numbers to Netsuite and using the get function to retrieve all internal id along with Bin id.

sada
  • 1