What would be the best way to update the Sales Ord...
# suitescript
s
What would be the best way to update the Sales Order, when the Item Fulfillment is created? I’m looking to update the line item from IF to update the SO line item. I can’t seem to figure out the link between these two aside from the body level
e
in suitescript you're looking on the item fulfillment's field 'createdfrom' and from there, line-items are linked by a field on the item fulfillment I think it's called 'orderline' to indicate the original SO item line, you should be able to access it via client script. You can verify this by inspecting xml from the orders (add "&xml=T" to the end of the URL)
🙌 1
s
Thanks so much!!! I did see the orderline from the IF, but can’t see this on the SO, so dumb that I thought they’d need to match per se Checking with my test SO and IF, The orderline holds “1” in IF But in SO, that line is on “0"
e
I might have the field name wrong. Inspect the xml for both orders, there is one field where Number(salesorder.field1) === Number(itemfulfillment.field2). I think it is an undocumented field as far as the record browser is concerned (on the IF). On the SO I am pretty confident 75% the fieldname is 'line', I don't believe it is the same fieldname on the IF.
s
On it! Appreciate the quick response
🖖 1
b
the order line field on the item fulfillment matches the line field on the sales order
do not make the mistake of confusing the line sequence number with the line id
the order line and line fields refer to the line id
s
Thanks a lot @battk! Got confused with the lines -.-
m
@battk @Emily S I have one concern here. Doing the same as @Schwifty but updating an item on an item receipt (IR) and after it on the item fulfillment (IF) itself. When getting the orderline on the IR (first screenshot) It brings a value of 3 and on the IF (second screenshot) it brings a value of 2. On the other items is also a difference of 1 for every item of IR, can I assume this ?? What are your thoughts about it? Any suggestion? Thanks in advance!
b
doesnt sound sane, item receipts and item fulfillments dont refer to the same order
e
@Matteo Balduccio I think that orderline might mean something different in the case of IRs. If you look on the IR you have
itemshipline==0
which matches up to the IF
line==0
. So maybe to get the sales/transfer/purchase order line you have to jump from IR to IF to SO/TO/PO. It also looks like you are dealing with a kit item or item group component? That may affect it as well. When we deal with kits I have to deal with fields kitmemberof and kitlineid, those can help match up as well. Sorry not much more help than that, I'm a fairly green NS user.
m
@battk sorry, forgot to mention in this case it is related to a Transfer Order. @Emily S I think that finding of yours related to the
itemshipline
just nails on the issue I'm having. The way the IR and IF lines are being related seems to be IR
itemshipline
and IF
line
for all the other lines too! I will review further the documentation and do some more tests. Thanks both!
🖖 1
b
in that case, both if and ir orderlines refer to lines on the transfer order, though transfer orders are one of those transactions where each line is actually represented by multiple lines in the backend
keep in mind, the line does not actually refer to the order sequence number, it refers to the line id
🙌 1