Hey everyone, I’m creating items receipts for purc...
# suitescript
l
Hey everyone, I’m creating items receipts for purchase orders as I get the confirmations from our logistics provider, that means that I would create multiple item receipts for a single purchase order (partial receipts). Basically it either fails with ‘Adding new line to sublist item is not allowed.’ when I try to specify the item_receipt_item_list and if I omit the item_receipt_item_list it created the receipt for all the items in the PO, which is not helpful. Any tips?
b
same as in the ui, you can unmark the items you aren't receiving by unchecking the receive checkbox (
itemreceive
). Or you can modify the
quantity
column to be the quantity you received
l
On my test I have a PO with a single line, I’m providing the line with quantity 1. But then I get the error
Adding new line to sublist item is not allowed.
b
you can't add or remove items from the items sublist of the item receipt, its not an inlineeditor sublist.
that said, what does your code look like
l
I’m doing it form backend using Netsweet ruby gem, but I assume it is the same problem, I can’t create the item_receipt_item, I have to update it, right?
Copy code
ns_item_receipt_item_list = NetSuite::Records::ItemReceiptItemList.new(replace_all: false)
ns_item_receipt_item_list.items << Netsuite::Records::ItemReceiptItem.new(
  item: item_ref,
  quantity: 10
)
ns_item_receipt = NetSuite::Records::ItemReceipt.new(
            tran_date: @item_receipt.date.to_datetime,
            created_from: record_ref(100),
            memo: @item_receipt.description,
            item_list: ns_item_receipt_item_list,
            location: record_ref(109),
)

ns_item_receipt.add
b
oh, wrong channel, you want #C2K2RJNAC. that said, you are creating item receipts wrong. just like in the ui or script for that matter, you need to create the item receipt from the purchase order and then modify it https://system.na2.netsuite.com/app/help/helpcenter.nl?fid=section_n3681685.html Use the initialize operation to create the item receipt from the purchase order. modify the item receipt returned from that operation and then add it
l
awesome, thank you for the directions! I will read the link and try to use the initialize operation 👍