web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

How to Delete/ Remove a posted payment journal on dynamics AX 2009

(0) ShareShare
ReportReport
Posted on by

I need to delete/remove a posted payment journal number. because, the posted journal is still showing as pending instead of close. And, i need closed the account at the end of this year. is preventing me not to do that

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at

    I need to delete/remove a posted payment journal number. because, the posted journal is still showing as pending instead of close. And, i need to closed the account at the end of this year. this is preventing me not to close the account.

    Please, can anyone assist me on this issue.

    Thanks.

  • Suggested answer
    Zeeshan Adeel Profile Picture
    335 on at

    private void deleteVouchers()

    {

       SubledgerVoucherGeneralJournalEntry objSubledgerVoucherGeneralJournalEntry;

       GeneralJournalEntry objGeneralJournalEntry;

       GeneralJournalAccountEntry objGeneralJournalAccountEntry;

       SubledgerJournalAccountEntry objSubledgerJournalAccountEntry;

       LedgerJournalTable ledgerjouranlTable;

       LedgerJournalTrans LedgerJournalTrans;

       LedgerJournalId journalNum;

       ;

       ttsBegin;

       journalNum ='000521_010';

       while select LedgerJournalTrans

               where LedgerJournalTrans.JournalNum ==journalNum

       {

       while select forUpdate objSubledgerVoucherGeneralJournalEntry

                   Where objSubledgerVoucherGeneralJournalEntry.Voucher == LedgerJournalTrans.Voucher

                  // || objSubledgerVoucherGeneralJournalEntry.Voucher == objVendPackingSlipVersion.CostLedgerVoucher

               {

                   while select forUpdate objGeneralJournalEntry

                   Where objGeneralJournalEntry.RecId == objSubledgerVoucherGeneralJournalEntry.GeneralJournalEntry

                   {

                       while select forUpdate objGeneralJournalAccountEntry

                       Where objGeneralJournalAccountEntry.GeneralJournalEntry == objGeneralJournalEntry.RecId

                       {

                           while select forUpdate objSubledgerJournalAccountEntry

                           Where objSubledgerJournalAccountEntry.RecId == objGeneralJournalAccountEntry.GeneralJournalEntry

                           {

                               objSubledgerJournalAccountEntry.delete();

                           }

                           objGeneralJournalAccountEntry.delete();

                       }

                       objGeneralJournalEntry.delete();

                   }

                   objSubledgerVoucherGeneralJournalEntry.delete();

               }

       }

       while select forUpdate ledgerjouranlTable where

               ledgerjouranlTable.JournalNum==journalNum

       {

             while select forUpdate LedgerJournalTrans where

               LedgerJournalTrans.JournalNum==ledgerjouranlTable.JournalNum

                   {

                       LedgerJournalTrans.delete();

                   }

                   ledgerjouranlTable.delete();

       }

  • Community Member Profile Picture
    on at

    I just want to delete only the particular journal number am having issue with that has been post and still showing has open instead of posted. the delete icon is not active to delete it.

  • Suggested answer
    Mahmoud Hakim Profile Picture
    17,887 on at

    The standard behavior , delete bottom wasn't enabled for posted transaction in payment journal.

    You can check the reason for this issue , but deleting is the bad solution

  • Ludwig Reinhard Profile Picture
    Microsoft Employee on at

    Hi,

    Are you absolutely sure that the journal is posted and that vouchers are created?

    Doesn't your journal has a log with additional details?

    Best regards

    Ludwig

  • Suggested answer
    Zeeshan Adeel Profile Picture
    335 on at

    go with the posted above code on a test enviroment and check your results for verification. if all goes right then perform this to the LIVE.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Joris dG Profile Picture

Joris dG 5

#2
Andrew Jones a1x Profile Picture

Andrew Jones a1x 2

#3
Basit Profile Picture

Basit 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans