Get Next Journal Entry Number

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;


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'

Related posts:
Feature Explained: Allow Account Entry
Integration Manager Error: Source Document ‘GJ’ Does Not Exist
Locked Payables Transaction: You cannot display this record while another user is editing it
Missing Transaction In Cashbook Bank Management?
Feature Explained: Reporting Ledgers
Testing Remittances By Email – Keeping Emails Internal
Ian Grieve

About Ian Grieve

Consultant with over 8 years experience with Microsoft Dynamics GP, including related products such as Integration Manager, eConnect, FRx and Management Reporter.
This entry was posted in Dynamics, GP, Microsoft and tagged , , , , , . Bookmark the permalink.

3 Responses to Get Next Journal Entry Number

  1. Pingback: Get Next Journal Entry Number | Interesting Findings & Knowledge Sharing

  2. Pingback: Get Next Journal Entry Number | azurecurve - DynamicAccounting.net - GP Technical Blogs - Microsoft Dynamics Community

Leave a Reply

Your email address will not be published. Required fields are marked *

*

* Copy this password:

* Type or paste password here:

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>