I am trying to receive inbound shipments in a M/R ...
# suitescript
s
I am trying to receive inbound shipments in a M/R script via loading
record.Type.RECEIVE_INBOUND_SHIPMENT
for the inbound shipment. This then transforms into an Item Receipt. However I need to set custom fields on this Item Receipt. Is there a way to do that? I haven't found one so far. I've tried loading the item receipt after saving the Receive Inbound Shipment, but it can never load. I could potentially set a timeout and wait after every transaction to give the item receipt time to be created before trying to load it, but obviously that would significantly slow down my script so that is not ideal. How could I best set fields on the item receipt when receiving inbound shipments?
e
Have you tried setting the custom fields on record create of the item receipt?
t
I would agree with @Eric B that probably bet to have the idea of approach to some kind of UE on the item receipt via fieldId: inboundshipment in some way acting like a createdfrom
s
I was afraid a UE script would be the answer. I try to keep our bundle as minimal as possible as a lot of clients already have a ton of UE clutter. I'm sort of holding out hope theres a solution I can implement within my M/R script.
How can there be no way to pass field values through to the Item Receipt when I'm receiving an inbound shipment?
r
Cant you call another MR in the summary stage after your script is done with all its process, where you can pass the relevant info and that script will update the IRs.
s
ooh I can investigate that idea, would I still need to do it from a separate/new M/R or maybe i could do it actually inside the summary step?
I'm actually also currently not utilizing the reduce step, but idk if the IRs will be created by then/if i could utilize it for that purpose
r
Doing it inside the summary step will not be wise even though the summary has a 10000 usage limit, if your MR is processing a lot of inbound shipment it might not be enough, plus doing that much task in summary will utilize too much queue time. You could ideally do the stuff in the same script and call another deployment. But your script will have a few conditional statements in input and in map stage. Although I hope someone can provide a better solution than this. Haven't worked on inbound shipments through scripting yet and this not really sure what should be the best approach.
s
Would trying to do it in the reduce step be less dangerous than doing it in the Summary step? And would the IRs even be generated by then...
r
Not really sure, try and test for a small data set.
👍 1
197 Views