Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP (Archived)

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

Posted on by 25

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

  • Tim Wappat Profile Picture
    Tim Wappat 5,701 on at
    RE: How Can I get last inserted Sopnumbe from sales order table.

    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

  • Niraj Parekh Profile Picture
    Niraj Parekh 25 on at
    RE: How Can I get last inserted Sopnumbe from sales order table.

    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
    Tim Wappat 5,701 on at
    RE: How Can I get last inserted Sopnumbe from sales order table.

    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
    Niraj Parekh 25 on at
    RE: How Can I get last inserted Sopnumbe from sales order table.

    Hi ,MUHAMMAD FAISAL  

    I want that using eConnect  can you help on this.

  • MFaisalDev Profile Picture
    MFaisalDev 20 on at
    RE: How Can I get last inserted Sopnumbe from sales order table.

    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

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

Featured topics

Product updates

Dynamics 365 release plans