Solved

Get Next RETDOCID in Microsoft Dynamics Great Plains stored procedure

Posted on 2015-01-20
2
180 Views
Last Modified: 2015-01-21
I'm trying to find a stored procedure in Great Plains that gets the next RETDOCID. I was hoping to be able to find something similar to taGetSopNumber, but if that's not available, what would be the best method for generating the next RETDOCID when creating an RMA?

Thank you in advance!
0
Comment
Question by:echobridge
2 Comments
 
LVL 18

Accepted Solution

by:
Steve Endow earned 500 total points
ID: 40561102
Hi,

I believe the stored proc you are looking for is:

SVC_New_DocumentID

Here is the SQL call that GP performs to generate the next RMA number.

BEGIN 
DECLARE @stored_proc_name char(26) 
DECLARE @retstat int 
DECLARE @param2 char(15) 
SELECT @param2 = '' 
SELECT @stored_proc_name = 'TWO.dbo.SVC_New_DocumentID' 
EXEC @retstat = @stored_proc_name 'RMA', @param2 OUT 
SELECT @retstat, @param2 
END 

Open in new window


Let me know if that works for you.

Thanks,

Steve Endow
Microsoft MVP - Dynamics GP
Dynamics GP Certified IT Professional
0
 
LVL 1

Author Closing Comment

by:echobridge
ID: 40562005
Perfect! Exactly what I was looking for.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
CRM Comparsion 3 37
t-sql complement 8 31
Using a SELECT statement inside of a CASE 5 16
SQL Script to find duplicates 16 19
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now