Salesline field validation

mo_x
Member Posts: 50
Hello everibody, I have a Salesorder that i post as "Ship". The salesline of the order can be modified by standard. How can i code so that the "quantiity" field on salesline cannot be changed, but others can. Is it possible to make some kind of error exception?. I'm trying to implement the solution using codeunit.
0
Best Answer
-
if done as in example (Quantity <> xRec.Quantity) will ensure its executed only if there is a change in Quantity field. You need to pass xRec (Copy of Rec before assignment) to your codeunit or place the code in SalesLine.OnModify.5
Answers
-
Table 37 Sales lines, OnModify:
Something similar how ReserveSalesLine.VerifyChange(Rec,xRec) works:
IF (Quantity <> xRec.Quantity) AND ItemExists(xRec."No.") AND ("Quantity Shipped" <> 0) THEN
FIELDERROR(Quantity);0 -
Thnx for reply JohnHunter. But this throws error for all the field. I just want for the quantity.0
-
if done as in example (Quantity <> xRec.Quantity) will ensure its executed only if there is a change in Quantity field. You need to pass xRec (Copy of Rec before assignment) to your codeunit or place the code in SalesLine.OnModify.5
-
Thanks John, that helped0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions