Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Suggested answer

Reverse Payment that already applied to Invoice

Posted on by 265

Hi all,

I'm trying to reverse automatically a payment to a Vendor using these steps.
Step 1) Unapply the payment from the invoice
Step 2) Reverse out the transaction.

Step 1 i have no problems.

When i try to reverse automatically Payment of a Vendor, i'm getting this error:

LOCAL InsertFromGLEntry(VAR TempRevertTransactionNo : TEMPORARY Record Integer;Number : Integer;RevType : 'Transaction,Register';VAR NextLineNo : Integer)
TempRevertTransactionNo.FINDSET;
REPEAT
IF RevType = RevType::Transaction THEN
GLEntry.SETRANGE("Transaction No.",TempRevertTransactionNo.Number);
// GLEntry.SETFILTER("Entry No.",'<>%1',0);
IF GLEntry.FINDSET THEN
REPEAT
CLEAR(ReversalEntry);
IF RevType = RevType::Register THEN
ReversalEntry."G/L Register No." := Number;

ReversalEntry."Reversal Type" := RevType;
ReversalEntry."Entry Type" := ReversalEntry."Entry Type"::"G/L Account";
ReversalEntry."Entry No." := GLEntry."Entry No.";
IF NOT GLAcc.GET(GLEntry."G/L Account No.") THEN 
ERROR(Text009,GLEntry.TABLECAPTION,GLAcc.TABLECAPTION);

Where
Text009 The transaction cannot be reversed, because the %1 has been compressed or a %2 has been deleted.

I know that i can manually reverse it using General Journal by
1) Debit Bank Acccount
2) Credit Vendor Account

But why i'm getting that error?

Thanks in advance

  • Suggested answer
    RE: Reverse Payment that already applied to Invoice

    Hello,

    this kind of error appears normally if you recently deleted or compressed data:

    https://docs.microsoft.com/en-us/dynamics365/business-central/admin-manage-documents#compress-data-with-date-compression

    For example, after you run the data compression for a certain period, you cannot un-apply vendor ledger entries for any account during the period/dates that were compressed.

    Could it be due to this?

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,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans