Sale Order API updating wrong line detail

Hi,

We are on X3 V12 90.24.54. 

I am updating some sales orders via C# using web services. What I have noticed is that the sales line details API is updating incorrect line details, even after explicitly setting  product code + line numbers. It seem that it is updating line detail based on the order received rather than observing the product code and line number.

An example is I have a sales order with four line details (1000 -> 4000). I only want to update line 4000.

My XML payload to the webservice is:

<?xml version="1.0" encoding="UTF-16"?>
<PARAM xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<GRP ID="SOH0_1">
		<FLD NAME="BPCORD">ABC001</FLD>
		<FLD NAME="SALFCY">UATSITE</FLD>
	</GRP>

	<TAB ID="SOH4_1" SIZE="1">
		<LIN NUM="1">
		<FLD NAME="ITMREF">HNP00019</FLD>
		<FLD NAME="NUMLIG">4000</FLD>
		<FLD NAME="SOPLIN">4000</FLD>
		<FLD NAME="QTY">12</FLD>
		<FLD NAME="ITMDES">This is a closed line really</FLD>
		</LIN>
	</TAB>
</PARAM>

I'm calling the webservice "SOH" endpoint, using the Modify method. The call is working correctly and updating the line detail, unfortunately, its the wrong line detail.

I've tried omitting the SOPLIN field, etc. If I omit the NUMLIG field, then a new line detail is inserted (as expected).

Any ideas?

  • What if you change "<LIN NUM="1">" to <LIN NUM="4"> ?

  • in reply to Mike Shaw

    It looks like that worked. Thanks.

    However, the API is really weird as I can overwrite line details just by changing the LIN NUM.

    I changed to LIN NUM=4 but explicitly set the ITMREF = "HSS3016" and NUMLIG = "2000" and the API happily changed the item on line 4... even though it was the wrong item code. Why? Where's the internal validation on this API?

    How are other people using the X3 API to add/update sales order?