Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP (Archived)

UNPOSTED BATCHES ACROSS ALL DATABASES

Posted on by Microsoft Employee

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
    Community Member Microsoft Employee 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
    Andrew John Dean 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
    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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans