web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Block double entry of item number in the sales line

(0) ShareShare
ReportReport
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

I have the same question (0)
  • Verified answer
    Binesh Profile Picture
    7,887 on at

    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

  • luapolemunges Profile Picture
    5 on at

    Hi Binesh,

    It worked as I wanted thanks alot

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans