Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Suggested answer

Using eConnect to update back order quantities.

Posted on by 75,730

I have been asked to create an integration to a third-party warehouse. I will be exporting sales orders daily. On all the lines on these sales orders will have the quantities back ordered. Once these orders are shipped from the third-party warehouse they will send over records for these same orders only now the quantities on the lines will be shipped. My question is using eConnect and the UpdateExisting flag on sales orders, will I be able to update the quantity fields and have all the internal GP logic take place?

Categories:
  • Richard Wheeler Profile Picture
    Richard Wheeler 75,730 on at
    RE: Using eConnect to update back order quantities.

    Isaac, here is what I believe is causing the problem.

    1) Orders are exported on a daily basis. An order goes out.

    1) The original order was exported with a QUANTITY of 20.

    2)  An import file is received indicating only 2 were shipped. My import routine correctly updates the quantities.

    3) Their people go into this order and get it set to be invoiced changing QTYTBAOR to 0 and QTYTOINV to 18  -- Here I believe is what is creating the problem.

    4) Sometime later this order ships again and we get a new file with the quantity shipped. What I am doing is taking that quantity and adding the QTYPRINV and subtracting that from QUANTITY to be QTYTBAOR

    They are breaking my logic by adjusting the quantities. I am thinking of someway undoing what they have done and resetting the quantities so my import routine will work. I either do that or get them to stop adjusting the quantities.

  • Suggested answer
    Isaac Olson Profile Picture
    Isaac Olson on at
    RE: Using eConnect to update back order quantities.

    Hi Richard,

    I haven't tested this exact scenario personally in my system, but eConnect is doing this calculation on the lines when you receive this error:    

    if (@QTYPRBAC + @QTYPRBOO + @QTYPRINV + @QTYPRORD + @I_vQTYCANCE + @I_vQUANTITY + @I_vQTYTBAOR + @I_vQUOTEQTYTOINV > @I_vTOTALQTY)

    So if those fields add up and they are greater than the total quantity, you will get that error.  

    Now I don't know what your line looks like before you are trying to update it so I will have to guess.  But lets say that your line had 18 quantity on it and 5 were previously invoiced.  Ince that case you would only pass in 13 quantity to invoice <QUANTITY>13.00000</QUANTITY> and pass in 18 total quantity <TOTALQTY>18.00000</TOTALQTY> because 5 were previously invoiced.  

    Or if you actually had 23 total quantity on this Order and 5 were previously invoiced, then you would pass in 18 Quantity and 23 total quantity.  Basically you have to compensate for the quantities on your sales line that have been previously invoiced because when you update existing sales lines, you are essentially removing and replacing the existing line for the quantities that have not been previously invoiced or back ordered yet, but the total on the line has to compensate for those values.  

    I hope this helps!

    Isaac Olson

    Microsoft Support

  • Richard Wheeler Profile Picture
    Richard Wheeler 75,730 on at
    RE: Using eConnect to update back order quantities.

    I am passing both the QTYTOIVC and QTYTBAOR. I have tried several variations and I cannot get these to work. This only fails for lines that were partially invoiced. QTYPRINV has a value.

    eConnectException: Sql procedure error codes returned:

    Error Number = 4777  Stored Procedure= taSopLineIvcInsert  Error Description = Quantities can not exceed total quantity plus quantity already transferred

    Node Identifier Parameters: taSopLineIvcInsert

    SOPNUMBE = WEB000885464

    SOPTYPE = 2

    LNITMSEQ = 65536

    Related Error Code Parameters for Node : taSopLineIvcInsert

    UpdateIfExists = 1

    QTYCANCE = Note: This parameter was not passed in, no value for the parameter will be returned.

    QUANTITY = 18.00000

    QTYTBAOR = Note: This parameter was not passed in, no value for the parameter will be returned.

    QUOTEQTYTOINV = Note: This parameter was not passed in, no value for the parameter will be returned.

    TOTALQTY = 18.00000

    <taSopLineIvcInsert>

     <SOPTYPE>2</SOPTYPE>

     <SOPNUMBE>WEB000885464</SOPNUMBE>

     <CUSTNMBR>12626</CUSTNMBR>

     <DOCDATE>3/1/2022 12:00:00 AM</DOCDATE>

     <LOCNCODE>HANDM</LOCNCODE>

     <ITEMNMBR>E5384-0000-000</ITEMNMBR>

     <UNITPRCE>18.86000</UNITPRCE>

     <QUANTITY>18.00000</QUANTITY>

     <LNITMSEQ>65536</LNITMSEQ>

     <SHIPMTHD>HNM</SHIPMTHD>

     <ALLOCATE>1</ALLOCATE>

     <UpdateIfExists>1</UpdateIfExists>

     <TOTALQTY>18.00000</TOTALQTY>

     <DEFEXTPRICE>1</DEFEXTPRICE>

    </taSopLineIvcInsert>

    Inner Exception:

  • Richard Wheeler Profile Picture
    Richard Wheeler 75,730 on at
    RE: Using eConnect to update back order quantities.

    Isaac, this description makes sense. This will force the normal GP engine to kick in and update all the quantities accordingly. If this integration works quantities on both sides should always be the same. So what I will get are only those quantities that are available.

  • Suggested answer
    Isaac Olson Profile Picture
    Isaac Olson on at
    RE: Using eConnect to update back order quantities.

    Hi Richard, 

    When you use the 'UpdateExisting' flag on Sales Orders, it will essentially delete the current Sales Order Line, and the replace it with a new line containing the parameters that you passed in through eConnect.  So lets say that your sales order line has 10 quantity back ordered and now you purchased 6 quantity but still have 4 left on back order.  You would have to use the UpdateExisting and pass in 6 quantity to invoice 4 quantity to back order on the new line.   You can't just update the quantity back ordered to go from 10 to 4 and assume that GP will know the 6 quantity are not ready to invoice, you have to pass the whole line back in through eConnect to replace the existing line. 

    I hope this makes sense, but the way that I think of the UpdateExisting on Sales Transactions thought eConnect is more like 'Delete and Replace' for the lines on the document.  

    Thanks!

    Isaac Olson

    Microsoft Support

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans