web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

How Can I get last inserted Sopnumbe from sales order table.

(0) ShareShare
ReportReport
Posted on by 29

Hi,

I am working on project where i needs to add sales order into Microsoft dynamics GP using eConnect.

I am to insert the data into Sale order processing table.(SOP10100) But I want that which Sopnumbe is created how can i get last inserted  Sopnumbe.

Thanks,

NIraj

*This post is locked for comments

I have the same question (0)
  • MFaisalDev Profile Picture
    26 on at

    Hi Niraj

    This query below should give you the last Sale Item.

    SELECT TOP 1

    HH.DOCDATE Last_Sale,

    HH.CUSTNMBR Customer_ID,

    HL.ITEMNMBR Item_Number,

    HL.ITEMDESC Item_Description

    FROM

    SOP30200 HH

    INNER JOIN

    SOP30300 HL

    ON HH.SOPTYPE = HL.SOPTYPE

    AND HH.SOPNUMBE = HL.SOPNUMBE

    WHERE

    HH.SOPTYPE = 3

    AND HH.VOIDSTTS = 0

    ORDER BY HH.DOCDATE DESC

    Thanks

  • Niraj Parekh Profile Picture
    29 on at

    Hi ,MUHAMMAD FAISAL  

    I want that using eConnect  can you help on this.

  • Tim Wappat Profile Picture
    5,711 on at

    You have choices;

    Use the eConnect GetNextDocNumbers method to get the document number before submitting your eConnectDocument, then using that fetched number in your SOPNUMBE fields, so you are "manually" getting the next number and submitting the doc with that number. Thus you know the number created.

    see: carldesouza.com/.../

    Or you can use the post econnect procedure for the transaction, to write the inserted document number into a custom table that you can then query after inserting the document. You could pass a key in one of the eConnect user defined fields to use to look it back up after the creation so you know its the same one you just created.

    eConnect will not return the number to you directly (which would have been nice).

    Tim

  • Niraj Parekh Profile Picture
    29 on at

    can also tell me the reason behind this issue.

    Microsoft.Dynamics.GP.eConnect.eConnectException

    Message : Sql procedure error codes returned:

    Error Number = 1008  Stored Procedure= taSopLineIvcInsert  Error Description = Procedure taSopLot returned an error value

    Node Identifier Parameters: taSopLineIvcInsert

    SOPNUMBE = ORD0128913

    SOPTYPE = 2

    Error Number = 2621  Stored Procedure= taSopLot  Error Description = The Quantity entered for this Lot is not available in the IV00300

    Node Identifier Parameters: taSopLot

    SOPNUMBE = ORD0128913

    SOPTYPE = 2

    ITEMNMBR = 10014238

    Related Error Code Parameters for Node : taSopLot

    ITEMNMBR = 10014238

    LOCNCODE = DISTRIB

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

  • Tim Wappat Profile Picture
    5,711 on at

    I don't use lots but I would have thought you don't have enough available stock in the lot you for the quantity that you are trying to order.

    Tim

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

#1
mtabor Profile Picture

mtabor 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans