I am writing a suite script which should create an...
# suitescript
s
I am writing a suite script which should create an item receipt in netsuite. The flow is: Purchase order -> Inbound shipment -> item receipt. However, what am I supposed to transform, the purchase order? The inbound shipment? If I transform the purchase order, there are no available lines to receive. This is confirmed in the UI. If I try to transform the Inbound Shipment into an Item Receipt however, I get a script error that such a transformation is not allowed. What is the correct way to generate an item receipt via suitescript in an Inbound Shipment flow?
b
s
Ah ok so from this i can see a few things: 1. I definitely cannot transform the Inbound Shipment 2. I can create a RECEIVE_INBOUND_SHIPMENT record that has the same ID as the inbound shipment in order to receive items?
The question then is, if I receive my items here, does that generate an item receipt? And if not, is that an issue with my item setup or a global setting? Because I need to be creating an item receipt for the purchase order, based on my understanding from my client.
b
this should be fairly easy to figure out once you actually try it
s
I'm trying it but the line count on my Receive Inbound Shipment is -1 for the sublist receiveitems...
b
before we go much further, do you know how to work with a inbound shipment in the ui
there are steps you must take before receiving an inbound shipment
s
It looks receivable in the UI. The answer is barely lol I am very new to this type, but I made one and in the UI I can click receive and my item is there with a checkbox, can send a screenshot if it would help
b
expect to know how to do everything you want to do in script via the ui
👍 1
s
but my item is not receivable on the original PO, so I dont know if that is a setup issue or intended. Google says it is intended, but my directions are definitely supposed to be to create an item receipt
b
figure out how to receive inbound shipments in the ui first
and then move onto the script
making records in script are not easier than the ui, if you are unconfident in the ui, you are more unconfident in script
s
I can receive it on the inbound shipment in the UI. What I am still questioning though is a) is there a setting that allows me to receive it on the PO via an item receipt or is my client confused? and b) if I am supposed to just receive on the inbound shipment, why is that receiveitems sublist -1
b
look at the related transactions of the inbound shipment you received
s
Not sure what you mean 😕
There's no related records subtab that I see on this record type in the UI, but if you mean just going to the PO it was generated from, I know which PO that is. But unfortunately I cannot receive my items from the PO. When I try, the button is clickable, however I have no available items to receive. When I receive the inbound shipment in the UI, it does show my item, but in the script it says the length of the receiveitems sublist is -1, which i think implies the sublist does not exist? Have triple checked spelling of receive lol
b
go in the ui and find where the related transactions for the inbound shipment are stored
if you cant find it, make sure you are using the standard form for the inbound shipment and that you actually received the line already
s
ahh ok in the UI the Receive Inbound shipment was able to successfully create an item receipt on my purchase order, yay 🙂 so just need to figure out why its -1 in the script then, which must be something stupid since I am just new to this type
b
did you create the inbound shipment from creation to receiving yourself
or did you work on a half completed inbound shipment
and missed that first half
s
I built a script to make the inbound shipment from the PO
And then imported it via my script
b
same process as before
s
I have another created via my script to try receiving
b
i dont think you know how to work with inbound shipments
s
I dont haha I am VERY new to them
b
and you are doing the equivalent of trying to ship an order pending approval
s
No, this was all already receivable
b
so, make sure you know how to create that inbound shipment from the ui first
s
Just not from my script
b
start from a new inbound shipment you create yourself and go through all the steps necessary to receive it
s
I just did
That was this
I just received the same Inbound shipment in the UI that I was getting receiveitems -1 with in my script
thank you so much for your patience by the way
it has been very difficult to wrap my head around inbound shipments 🙂
b
is this the same inbound shipment you already received in the ui
s
I have a second one but I may have found my error, about to test
it imported 🥲 I cannot thank you enough for your patience, your link and your help really saved me today