Here I have a enquiry card which i made and , I am entering notes in notes section,
After I revisit my notes after closing enquiry page tab, my notes get deleted automatically without manually deleting
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