A colleague is currently working on some development for Microsoft Dynamics GP and needs to create a journal.
I did some digging around the company database looking for the correct way to get the next Journal Entry number and found a function called glGetNextJournalEntry.
A little work and I was able to supply the following to the developer for him to wrap into a stored procedure to get the Journal Entry number and make sure there were no issues in GP;
/*
Created by Ian Grieve of azurecurve | Ramblings of an IT Professional (http://www.azurecurve.co.uk)
This code is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0 Int).
*/
DECLARE @l_tINCheckWORKFiles tinyint = 1
DECLARE @I_iSQLSessionID int = USER_SID()
DECLARE @O_tOUTOK tinyint
DECLARE @IO_iOUTJournalEntry int = 1
DECLARE @O_iErrorState int
EXECUTE glGetNextJournalEntry
@l_tINCheckWORKFiles
,@I_iSQLSessionID
,@IO_iOUTJournalEntry OUTPUT
,@O_tOUTOK OUTPUT
,@O_iErrorState OUTPUT
SELECT @IO_iOUTJournalEntry AS 'NJRNLENT', @O_tOUTOK AS 'OUTOK', @O_iErrorState AS 'ERROR'
What should we write about next?
If there is a topic which fits the typical ones of this site, which you would like to see me write about, please use the form, below, to submit your idea.
Looking for support or consultancy with Microsoft Dynamics GP?
I no longer work with Microsoft Dynamics GP, but the last company I worked for was ISC Software in the UK; if you’re looking for support or consultancy services with Microsoft Dynamics GP you can contact them here.
Take a look at my article http://dynamicsgpblogster.blogspot.com/2010/11/integration-manager-integrating-journal.html.
Keep up the good work!
MG.-
Mariano Gomez, MVP