Skip to main content

Notifications

Announcements

No record found.

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

My notes count is getting increased whenever I visit my new enquiry sales order page

Posted on by 200

1070.notes-goes-on-incrawing.png

Here I create a enquiry card which is when I create a new sales order it gets added in my enquiry list,

But when I add note in sales order and I revisit enquiry page its count is increasing, why it's happening.

Need it's solution please very urgent.

//Procedure code part where I added copylinks function 

                  recEnquiries.Description := rec_SalesHeader."External Document No.";

                    // recEnquiries."Internal Notes" := rec_SalesHeader.customDeliveryNotes;

                    recEnquiries.isArchive := false;

                    recEnquiries.DateCreated := DT2DATE(rec_SalesHeader.SystemCreatedAt);

                    recEnquiries."Sell-to Customer No." := rec_SalesHeader."Sell-to Customer No.";

                    recEnquiries."Location Code" := rec_SalesHeader."Location Code";

                    recEnquiries.Status := rec_SalesHeader.Status;

                    if rec_SalesHeader.HasLinks then // here I added

                        recEnquiries.CopyLinks(rec_SalesHeader);

                    recEnquiries.Insert(true);

                    InsertSalesLine(recEnquiries.No);

                end;

            until rec_SalesHeader.Next() = 0;

        end;

// Called this procedure in open page trigger

trigger openpage

Var

cd_enq : codeunit enquiry

Begin

cd_enq.insertsalesorder

End;

As I used openpage that's why my notes count is increasing on each visit? Please any solution.

  • Dividutt Profile Picture
    Dividutt 200 on at
    RE: My notes count is getting increased whenever I visit my new enquiry sales order page

    Hi, Nithin Verma Can you please show some example with my code, how u meant?

    Not getting the required output after creating new procedure?

  • Nitin Verma Profile Picture
    Nitin Verma 21,091 Super User 2024 Season 1 on at
    RE: My notes count is getting increased whenever I visit my new enquiry sales order page

    Not same, only for update Links or notes.

    Thanks

  • Dividutt Profile Picture
    Dividutt 200 on at
    RE: My notes count is getting increased whenever I visit my new enquiry sales order page

    Write the same function in new procedure? And modify() ?

  • Nitin Verma Profile Picture
    Nitin Verma 21,091 Super User 2024 Season 1 on at
    RE: My notes count is getting increased whenever I visit my new enquiry sales order page

    You can write another procedure to check and update the notes only on your enquire table.

  • Dividutt Profile Picture
    Dividutt 200 on at
    RE: My notes count is getting increased whenever I visit my new enquiry sales order page

    It's working,same note is not coming but if I want add different notes or update that note that is  not coming now I need to add different notes, so how we also can optimise that?

  • Suggested answer
    Nitin Verma Profile Picture
    Nitin Verma 21,091 Super User 2024 Season 1 on at
    RE: My notes count is getting increased whenever I visit my new enquiry sales order page

    Hi, You can check if recEnquiries has already links so dont copy the link

     if rec_SalesHeader.HasLinks then

                 if not recEnquiries.haslinks then

                           recEnquiries.CopyLinks(rec_SalesHeader);

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