Featured Post

Dynamics GP 2019 is now Released

It is now released, Microsoft Dynamics GP 2019 which moves the system to the modern product life cycle   " Beginning with the October...

Monday, November 19, 2018

Apply Payable Document Error


While applying a payment to a posted invoice in the payable module, an error pops up indicating that " You can't choose this document because it is part of a recovered batch or is still in the process of posting" as illustrated in the screen shot below.


Resolution:

Nothing exists in the batch recover, don't waste time looking for any corrupted records there 
This issue occurs due to having the same record ( mostly an invoice ) in both work and open tables (Unposted and Posted table) . As the apply function checks for any open transaction, duplicated records are found across PM10000 and PM20000, which results with this issue. 

In order to resolve the issue, you basically need to delete the record from the PM10000 which already exists in the PM20000. Then, try again and the apply payable document will work perfectly as designed. 

          DELETE FROM PM10000 WHERE VCHNUMWK = 'XXXXXXX'


Run the script as you replace the XXXXXXX with the specific voucher number which already exists in PM20000. 

Best Regards, 
Mahmoud M. AlSaadi

Monday, November 12, 2018

Year End Closing - Query Timeout Expired Error | "The Stored Procedure glYearEndCloseMain"

If you are performing the year end closing procedure and encountering the error " Query Timeout Expired" specifically at step 3 out 7, then an error message popped up " The stored procedure glYearEndCloseMain returned the following results DBMS ... ", you need to know that the GL year end closing procedure has failed as it partially closed the year. 




Issue Diagnosis :
When closing the year, Dynamics GP goes through seven steps precisely in order to reconcile GL balances, check returned accounts, account types ... etc and close the year. 
Step 3 calls stored procedure "glYearEndCloseMain" which primarily moves records from GL20000 to GL30000, create BBF records. Here is the SQL statement which is causing the system to hang:



BEGIN
    DECLARE @stored_proc_name CHAR(26);
    DECLARE @retstat INT;
    DECLARE @param23 NUMERIC(19, 5);
    DECLARE @param24 INT;
    DECLARE @param25 INT;
    SET NOCOUNT ON;
    SELECT @stored_proc_name = 'TWO.dbo.glYearEndCloseMain';
    EXEC @retstat = @stored_proc_name 2017,
                                      2018,
                                      1,
                                      'Z-US$',
                                      '',
                                      0,
                                      'AVERAGE',
                                      'CLOSE',
                                      639100,
                                      'GLTRX00014007',
                                      'DYNSA',
                                      '##0545413',
                                      '##0545449',
                                      '##0705413',
                                      1460,
                                      0,
                                      0,
                                      639100,
                                      639100,
                                      0,
                                      '2017.01.01',
                                      '2017.12.31',
                                      @param23 OUT,
                                      @param24 OUT,
                                      @param25 OUT;
    SELECT @retstat,
           @param23,
           @param24,
           @param25;
    SET NOCOUNT ON;
END;


Resolution
The very initial step to ensure that you restore Dynamics GP databases since in such case the GL tables would be partially corrupted due to having "partial year end closing"

The next step is to check the "Auto Growth - Maximum Size " property on the database server for the GP database. The case occurred due to having insufficient database size restricted by the maximum size. 




Best Regards,
Mahmoud M. AlSaadi