X3 V11 - Soap Web Service - Update a Sales Return

SOLVED

Hello,

I have written a barcode scanning solution that allows a team of users to collect SKU's against multiple Sales Returns (GR######)  called Good Returns.

As multiple users cannot be in the same Sales Return (GR) this prompted the development of the software to process the GR later on.

I have used the following code to create a new Sales Return:

<PARAM>
<GRP ID="SRH0_1" >
<FLD NAME="STOFCY" >MD004</FLD>
<FLD NAME="ENTRTNDAT" >20190530</FLD>
<FLD NAME="BPCORD" >M9006</FLD>
<FLD NAME="YBUILDING" >KNO</FLD>
</GRP>
<GRP ID="SRH1_1" >
<FLD NAME="BPCINV" >M9006</FLD>
<FLD NAME="YRTNRES" >CE</FLD>
</GRP>
<TAB DIM="999" ID="SRH1_4" SIZE="2" >
<LIN NUM="1" >
<FLD NAME="ITMREF" >CZ9171010</FLD>
<FLD NAME="EXTQTY" >5</FLD>
<FLD NAME="RTNREN" >CE</FLD>
<FLD NAME="QTY" >5</FLD>
</LIN>
<LIN NUM="2" >
<FLD NAME="ITMREF" >PRSSA0035</FLD>
<FLD NAME="EXTQTY" >5</FLD>
<FLD NAME="RTNREN" >CE</FLD>
<FLD NAME="QTY" >5</FLD>
</LIN>
</TAB>
</PARAM>

I would like to ask the group if they know how to compose the <PARAM> code to update an existing Sales Return, each return will have a number of SKU's associated all with an expected value.

For example. A Sales Return with 1 expected Item.

GRNUMBER:    GR294054

SKU:   BXC901B42

DESCRIPTION: SHOE SPD MTB XC9 (XC901) BE size 42

EXPECTED:    1.0000000000000

Returned: 0.0000000000000

REMAINING:   1.0000000000000

ReturnType: CE

LineNo:   1000
   

The users will scan the Sales Return number (GR294054) and each of the SKUs, my software checks stock levels and if a part if obsolete.

All items that are good and can go back into the warehouse need to be received.

Hopefully someone from the community has come across this issue before and can help.

many thanks

Andrew

  • +1
    verified answer

    Hello,

    Thought I would update my ticket as I have found an alternative solution that by passes using the web service, instead we build a comma separated data file and import direct into X3 via FTP.

    The file needs to have a prefix of itlext for X3 to process the file.

    The file contains the following information:

    ITL,E,Receipt,+,0,+,QTYReturned,YYYYMMDDHHmmSS,CUSTOMER,SKU,,,,,SALESRETURN,LINENUMBER,,,,,,,,,,,,,CUSTOMER,,

    For example, if your Sales Return has a line with 5 items expected and you want to return 2 items, X3 will create a new line expecting 3 items and update the original line to say expecting 2 and received 2.

    You will need to query the X3 database to find the new Linenumbers that were added.

    select SRHNUM_0 as 'GRNUMBER' ,ITMREF_0 as 'SKU', ITMDES_0 as 'DESCRIPTION',
    EXTQTY_0 as 'EXPECTED', QTY_0 as 'Returned',EXTQTY_0 - QTY_0 as 'REMAINING',
    RTNREN_0 as 'ReturnType', SRDLIN_0 as 'LineNo'
    from SRETURND
    where SRHNUM_0 = 'SALESRETURN' order by SRDLIN_0

    If anyone would like further information or help I am happy to assist.

    thanks

    Andrew