Skip to main content

Notifications

Small and medium business | Business Central, N...
Answered

while revisiting my enquiry system page the notes i entered is getting deleted.

Posted on by 200

Here I have a enquiry card which i made and , I am entering notes in notes section, 

enq1.png

After I revisit my notes after closing enquiry page tab, my notes get deleted automatically without manually deleting

enq-3.png

I share my code what can be done here why its getting deleted please help.

codeunit 50425 "Enquiries notes"
{
    procedure CopyLinksFromEnquiriesToSalesHeader(rec_SalesHeader: Record "Sales Header")
    var
        recordLink: Record "Record Link";
        recEnquiries: Record "Enquiries";
        rec_EnquiriesLine: Record "Enquiries Line";
    begin

        // Check if the Enquiries record has any links
        recEnquiries.SetRange(No, rec_SalesHeader."No.");
        if recEnquiries.FindSet() then begin

            if recEnquiries.HasLinks then begin
                // Delete any existing links for the Sales Header record
                rec_SalesHeader.DeleteLinks();

            end;
        end;
    end;

}
//I call codeunit it in openpage trigger
  • Dividutt Profile Picture
    Dividutt 200 on at
    RE: while revisiting my enquiry system page the notes i entered is getting deleted.

    But if not use deletelinks() the notes get repeated in each time in open page so I needed to add delete link,

    So how can we maintain that?

  • Verified answer
    YUN ZHU Profile Picture
    YUN ZHU 72,941 Super User 2024 Season 2 on at
    RE: while revisiting my enquiry system page the notes i entered is getting deleted.

    Hi, it seems that your custom enquiry card background table is also a Sales header? The RecordID of the enquiry card background table is the same as that of rec_SalesHeader, so if rec_SalesHeader is cleared, it will also be deleted on the enquiry card.

    pastedimage1684196247221v2.png

    pastedimage1684196291471v3.png

    Hope this helps.

    Thanks.

    ZHU

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Complete!

🔔 Be sure to subscribe to the new forums you are interested in to stay up to date! 🔔

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 229,918 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans