Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

how to stop to delete the line

Posted on by 1,835

24036.UU.png

Dear All,

Is there any possibility if all three checkbox are checked..then user can not detete the line section.
What I need to do now. I want to write the code. Where I need to do now. In page or table. What I need to write the code(In which trigger).
Please suggest me. and give the idea to write the code.

Manish

*This post is locked for comments

  • Suggested answer
    TharangaC Profile Picture
    TharangaC 23,116 on at
    RE: how to stop to delete the line

    I really think it would be good if you first read a bit on NAV and then start on development. As mohana said in the forum we will support you as long as you put your effort on the process.

  • Binesh Profile Picture
    Binesh 7,885 on at
    RE: how to stop to delete the line

    Hello Manish,

    You can write in either page or Table, But as per Mohana first read triggers.
    Better to write in Table.
    for example your page is belongs from SalesHeader and SalesLine then write something like:
    in Table SalesLine OnDelete() Trigger
    -------------------
    SalesHeader.RESET;
    SalesHeader.SETRANGE("No.","Document No.");
    IF SalesHeader.FINDFIRST THEN
       IF NOT ((SalesHeader."Released for Technical")
           AND (SalesHeader."Released for Comercial")
           AND (SalesHeader."Released for Production")) THEN
       ERROR("Your message here for end user!");

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: how to stop to delete the line

    On page 46 (in nav  2016 is "order subform"  on event OnDeleteRecord() place an if clause that checks if all the 3 checkboxes are checked. If so, place an EXIT()

  • Suggested answer
    Mohana Yadav Profile Picture
    Mohana Yadav 59,139 Super User 2024 Season 2 on at
    RE: how to stop to delete the line

    manish,

    Press F1 and read about the triggers.

    Forum is to give suggestions and not to write code for you.

    Please check Ondelete trigger and try to write some code and let us know if you face any issues.

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,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans