Skip to main content

Notifications

Microsoft Dynamics NAV (Archived)

Block double entry of item number in the sales line

Posted on by 5

Am  new in navision development I want to block a user from entering two same item number in the sales line this is because the user can inserts different quantities in the two lines in the same order number and two same item numbers want to have only one item number in the sales line not repeating the items number in the lines.Am using navision 2015.

*This post is locked for comments

  • luapolemunges Profile Picture
    luapolemunges 5 on at
    RE: Block double entry of item number in the sales line

    Hi Binesh,

    It worked as I wanted thanks alot

  • Verified answer
    Binesh Profile Picture
    Binesh 7,885 on at
    RE: Block double entry of item number in the sales line

    Hello luapolemunges,

    Create a function in codeunit, subscribe this function and write the below code or you can write this code in OnValidate - No.  field on sales Line Table

    //SalesLine is a record variable of sales line Table 37

    SalesLine.RESET;
    SalesLine.SETRANGE("Document Type", Rec."Document Type");
    SalesLine.SETRANGE("Document No.", Rec."Document No.");
    SalesLine.SETRANGE(Type, SalesLine.Type::Item);
    SalesLine.SETRANGE("No.", Rec."No.");
    IF SalesLine.FINDFIRST THEN
     ERROR('%1 item already exist in this order!', Rec."No.");

    for reference see attachments.

    1667.2.png

    1667.2.png

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... 290,900 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,275 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans