Skip to main content

Notifications

Announcements

No record found.

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

Reversing a posted sales credit memo in Business central

Posted on by Microsoft Employee

Is there any way  for reversing the sales credit memo in Business central

Posted a credit memo with different date, i.e  last month date in place of current  month date , Now  I want to Reverse a posted sales credit memo. 

  • ManishS Profile Picture
    ManishS 6,578 on at
    RE: Reversing a posted sales credit memo in Business central

    Sales Credit Memo is having Type as Item or GL Account.

  • Suggested answer
    Vaishnavi J Profile Picture
    Vaishnavi J 3,056 on at
    RE: Reversing a posted sales credit memo in Business central

    Hi  

    If you had created Posted Sales credit memo using the action Correct or Cancel in PSI then you can see the Cancel action only.

    or else you need to create a processing report or codeunit which takes the posting date and document no and fetches it all the ledger entries and update the posting date.

    if it is only one document then check its ledger entries which is affected using Find Entries action and get the ledger and sub ledger table and then hardcode the document no in your code and update only those table which is affected. This is risky process but make sure you perform in Sandbox before deploying it into production. You can follow the below logic but add only those tables which is affected by your document.

    codeunit 50123 MyCodeunit
    {
        Permissions = tabledata "Cust. Ledger Entry" = RIMD, tabledata "Sales Cr.Memo Header" = RIMD, tabledata "Detailed Cust. Ledg. Entry" = RIMD, tabledata "Item Ledger Entry" = RIMD;
        trigger OnRun()
        var
            Rec_CLE: Record "Cust. Ledger Entry";
            REC_PSCM: Record "Sales Cr.Memo Header";
            Rec_ILE: Record "Item Ledger Entry";
            Rec_VLE: Record "Value Entry";
            Rec_TE: Record "VAT Entry";
            Rec_DCLE: Record "Detailed Cust. Ledg. Entry";


        begin
            REC_PSCM.SetRange("No.", 'PS-CR104003');
            if REC_PSCM.FindFirst() then begin
                REC_PSCM."Posting Date" := 20180612D; // The date format must be yyyymmdd
                REC_PSCM.Modify(true);
                Rec_CLE.Reset();
                Rec_CLE.SetRange("Document No.", REC_PSCM."No.");
                if Rec_CLE.FindFirst() then begin
                    Rec_CLE."Posting Date" := REC_PSCM."Posting Date";
                    Rec_CLE.Modify(true);
                    Rec_DCLE.SetRange("Document No.", REC_PSCM."No.");
                    if Rec_DCLE.FindFirst() then begin
                        Rec_DCLE."Posting Date" := REC_PSCM."Posting Date";
                        Rec_DCLE.Modify(true);
                    end;
                    Rec_ILE.SetRange("Document No.", REC_PSCM."No.");
                    if Rec_ILE.FindFirst() then begin
                        Rec_ILE."Posting Date" := REC_PSCM."Posting Date";
                        Rec_ILE.Modify(true);
                    end;
                    Rec_VLE.SetRange("Document No.", REC_PSCM."No.");
                    if Rec_VLE.FindFirst() then begin
                        Rec_VLE."Posting Date" := REC_PSCM."Posting Date";
                        Rec_VLE.Modify(true);
                    end;


                end;

            end;
        end;


    }

    If my answer was helpful to you, please verify it so that other users know it worked. Thank you very much

  • Suggested answer
    Inge M. Bruvik Profile Picture
    Inge M. Bruvik 32,748 Super User 2024 Season 1 on at
    RE: Reversing a posted sales credit memo in Business central

    There is a cancel option in the upper left corner, that will reverse the credit memo.

    Please see screenshot

    pastedimage1659354333587v1.png

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,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans