Skip to main content

Notifications

Announcements

No record found.

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

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