Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

UNPOSTED BATCHES ACROSS ALL DATABASES

(0) ShareShare
ReportReport
Posted on by

Hi all -

Is there a way to view all unposted sales and GL batches across all the GP companies? Maybe a sql script? 

Thanks!

*This post is locked for comments

  • Community Member Profile Picture
    on at
    RE: UNPOSTED BATCHES ACROSS ALL DATABASES

    run this in each company: SELECT DB_NAME()db, BCHSOURC,BACHNUMB FROM sy00500 WHERE BCHSOURC IN ('Sales Entry','GL_Normal') AND NUMOFTRX >  0 AND BCHSTTUS = 0

  • Suggested answer
    Andrew John Dean Profile Picture
    1,337 on at
    RE: UNPOSTED BATCHES ACROSS ALL DATABASES

    Try the following script that uses   (i) Cursors   (ii) Dynamics SQL and (iii) Temporary tables

    CREATE TABLE [tag:TEMP] (BCHSOURC VARCHAR(15), BACHNUMB VARCHAR(15))

    DECLARE @INTERID VARCHAR(15), @SQL VARCHAR(1000)

    DECLARE COMPANY_CURSOR CURSOR FOR

    SELECT RTRIM(INTERID) FROM SY01500

    OPEN COMPANY_CURSOR

    FETCH NEXT FROM COMPANY_CURSOR INTO @INTERID

    WHILE @@FETCH_STATUS = 0

    BEGIN

    SET @SQL = 'INSERT INTO [tag:TEMP] SELECT BCHSOURC, BACHNUMB FROM ' + @INTERID + '..SY00500 WHERE BCHSOURC IN (''Sales Entry'', ''GL_Normal'')'

    EXEC(@SQL)

    FETCH NEXT FROM COMPANY_CURSOR INTO @INTERID

    END

    CLOSE COMPANY_CURSOR

    DEALLOCATE COMPANY_CURSOR

    SELECT * FROM [tag:TEMP]

    DROP TABLE [tag:TEMP]

    Regards

    Andrew Dean

    Envisage Software Solutions

  • Suggested answer
    babubaskaran@outlook.com Profile Picture
    10 on at
    RE: UNPOSTED BATCHES ACROSS ALL DATABASES

    Hi,

    You can create a custom smartlist using smartlist builder and select multi company.  Unposted sales transactions SOP10200 and GL10001 unposted work line details.

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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard >

Featured topics

Product updates

Dynamics 365 release plans