I’m working on a integration to create a sales ord...
# integrations
j
I’m working on a integration to create a sales order in Netsuite. The integration is coming in two separate phases. Original contract lines and then any changes update the sales orders and write the rest of the lines. In my test I have 3 original lines and 2 lines that come in on an update. The weird part is that the line numbers are off. I have line 1,2,3 and skips line 4 and goes to 4,5. Does anyone know what the line numbers are skipping around?
m
Line ID is not related to the position in the sublist and can change. (also there are hidden lines) Line Sequence Number would be the 1,2,3,4,5 etc.
Or I am fully misunderstanding your comment.
j
so if you look at the back end xml of the sales order the orderLine = 1,2,3,5,6. I’m trying to understand why they skip
b
order line is not the line number, its the line id
j
Here is a screenshot. The line and the orderLine are both doing the same thing
b
the order line refers to the line id of the associated order
the line refers to the line id of what im assuming is the contract
neither is related to the line sequence number
j
The line sequenceNumber isn’t showing at all. The external system I’m coming from is line 1-5 so I can’t tie anything out with the lines in netsuite not incrementing. Do you have any idea why they don’t increment correctly?
b
line sequence number is implied in this case
the first item element is the first line, the second line the second and so on
the line ids dont match the line sequence because they are used to uniquely identify a line
j
Same with the 3rd but skips 4
b
there are multiple reasons a line id may skip
a line may be removed
a line may be inserted
the previous line may actually represent multiple lines
j
That’s what I originally thought so I deleted the sales order and re-created it from scratch, and it still came over the same way.
b
you can explore reasons about how line ids work
but the end result is the same, the line id has no requirement to match the line sequence
writing logic that depends on the ids being in sequence are doomed
j
I know and with this other system I’m working with there isn’t a way to bring them over from there either
I added a line sequence function which works well if you are looking at it from the UI but on the back end its always a value of 1
c
Sounds like you need an external ID on the line if you want to be able to map between the two systems
👍 1