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
Hi Binesh,
It worked as I wanted thanks alot
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.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 290,900 Super User 2024 Season 2
Martin Dráb 229,275 Most Valuable Professional
nmaenpaa 101,156