Am still 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.
Why is the user entering two lines with the same item code but different quantities a problem for you?
Removing/Blocking the ability to do this could cause issues further down the line i.e. adding a line on a Sales Order that has been shipped out...
You can achieve this as follows: on the sales line table, in the OnValidate trigger of the "No." field, in the part where it says
CASE Type OF
You add this code:
//Start New Code >>SalesLine.RESET;SalesLine.SETFILTER("Line No.",'<>%1',"Line No.");SalesLine.SETRANGE("Document Type","Document Type");SalesLine.SETRANGE("Document No.","Document No.");SalesLine.SETRANGE("No.","No."); IF lrecSalesLine.FINDFIRST THEN ERROR(STRSUBSTNO('Item No. %1 is already on this sales order.',"No.");
//End New Code <<
Where SalesLine = a variable for table record 37
Hope this helps
One of my clients uses this modification too - it is to so pickers in the warehouse are not sent to look for the same item twice during a long pick.
Yes the same scenario where the dispatch team only pack one of the items and forgets other
will try this and get back tommorrow thanks alot
getting this error
There are other ways around this problem. If you are using advanced warehousing you should look into bin ranking and sort the pick by bin rather than item if possible...
want to block as sales order level when one is raising an order
I understand, you want to do this to prevent problems at the picking stage that's why I made the above suggestion... Just a suggestion
have put begin to end but there is still errors on this lines of code
error I get the error ""A value or expression was expected." For example100myvarmyvar = 100