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)

Get next Sopnumbe or docnumbr directly from tables

(0) ShareShare
ReportReport
Posted on by

Just a little background first.....

We bought GP 6.0 back in 2001 and the implementation was directed by a consultant.  At that time as a newbie developer and under direction from the consultant, I was told to write two stored procs to retrieve the next sopnumbe from SOP40300 and the next docnumbr from RM40401.  Which I did, and I've used in various apps to write files for Integration Manager.  Fast forward to today, we're on GP 10, getting ready for GP2010 and I need to update those external apps from VB6 to VB.NET.  

I've realized two things about how those custom stored procs work: 

  1. They don't do quite exactly the same thing as GP; we've had two people grab the same Sopnumbe on a few occasions over the past 10 years due to lack of record locking.
  2. They only allow for 5 numerical digits after the initial alpha character.  For example, our next payment number is P74503 and the next invoice is S73990.

At this rate, we're going to hit P99999 and S99999 fairly soon.  I really don't want to modify the procs when someone else has already invented the wheel.

I would like to use the stored procs built into GP's database in my .NET code and stop using the custom procs, but don't want to do it blindly or use the wrong ones.  I have found eConnect documentation online, but it gives method names, which I suspect call stored procs under the covers.  We don't have eConnect, and don't need it and don't plan to get it, so I can't go that route.

By process of elimination, I believe the stored procs I'm interested in are [taGetSopNumber] and [taGetPaymentNumber].  I used SSMS to script out these execute calls to see what all the parameters are; I have enough knowledge as to how to call them in .NET.

My question is: can anyone confirm that these procs retrieve values from SOP40300 and RM40401, respectively?

Thanks for any insight!

Beth

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at

    Bump - can anyone help?  Thank you!

  • Verified answer
    Community Member Profile Picture
    on at

    I received the following clarification from our VAR.  Looks like with a little testing I should be able to do what I want.  Hope this helps someone else!

    the two procedures you reference (taGetSopNumber; taGetPaymentNumber) are encrypted eConnect procedures, so the code is not extractable.

    I have used the ‘taGetSopNumber’ procedure myself on projects and know that it increments the next SOP Number. However, it will first try to retrieve/increment the next sop document number value from the SOP40200 table, based on the SOP Type and Doc ID, If it doesn’t find a match, it will then try to retrieve/increment the next document number value from the SOP40300 table, again based on the Type and Doc ID. You’d pass in ‘1’ for the @I_tInc_Dec parameter so it increments the number to the next value.

    The ‘taGetPaymentNumber’ procedure generates next numbers from the RM40401 table, based on the Document Type. I believe the Document Type for Payments is ‘9’. You’d pass in ‘1’ for the @I_tInc_Dec parameter so it increments the number to the next value. Even though the proc is named getpayment number, it also generates next numbers for Receivables invoices, debit memos, credit memos, etc…

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