Skip to main content

Notifications

Announcements

No record found.

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

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

(0) ShareShare
ReportReport
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 74,115 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

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 Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,445 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans