Sign Validation
ravi_navision
Member Posts: 102
Hi,
I have 2 fields. Qty1 and Qty2
When user enters on Qty2 field I want to validate Qty2 field sign should be
same as Qty1 field sign (Qty1 is non editable and always >0)
eg: Qty1 Qty2
+ve +ve
Thanks,
I have 2 fields. Qty1 and Qty2
When user enters on Qty2 field I want to validate Qty2 field sign should be
same as Qty1 field sign (Qty1 is non editable and always >0)
eg: Qty1 Qty2
+ve +ve
Thanks,
~~ravi
0
Comments
-
ravi_navision wrote:Hi,
I have 2 fields. Qty1 and Qty2
When user enters on Qty2 field I want to validate Qty2 field sign should be
same as Qty1 field sign (Qty1 is non editable and always >0)
eg: Qty1 Qty2
+ve +ve
Thanks,
If Qty 1 is always > 0 then basically you want that Qty 2 is also positive, so
Qty2 := Abs(qty2);
Qty 1 is absolutely irrelevant.David Singleton0 -
Qty can be Negative~~ravi0
-
ravi_navision wrote:Qty1 is non editable and always >0ravi_navision wrote:Qty can be Negative
How about you DECIDE what you want THEN we tell you how to code it.
PS a number greater than 0 is positive :whistle:David Singleton0 -
Thanks for your help David.
I wrote one line of code to validate.
IF ((Qty1 < 0) AND ("Qty2" >0)) OR ((Qty1 > 0) AND ("Qty2" <0)) THEN
Error( )
Just for my interest I want to know is there any other way of doing it.~~ravi0 -
ravi_navision wrote:Thanks for your help David.
I wrote one line of code to validate.
IF ((Qty1 < 0) AND ("Qty2" >0)) OR ((Qty1 > 0) AND ("Qty2" <0)) THEN
Error( )
Just for my interest I want to know is there any other way of doing it.ravi_navision wrote:Qty1 is non editable and always >0
But if Qty1 is always greater than 0 then Qty2 is also always greater than zero so ...
IF "Qty2" < 0 THEN
Error( );David Singleton0 -
Sorry. Small change
Qty1 is non editable and not equal to zero~~ravi0 -
ravi_navision wrote:Sorry. Small change
Qty1 is non editable and not equal to zero
Big change actually, but now it makes sense:
try :IF (Qty1 * "Qty2") < 0 THEN Error( )
David Singleton0 -
IF (Qty1 * "Qty2") < 0 THEN
Error( )
It works. Thank you David~~ravi0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 610 NAV Courses, Exams & Certification
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 251 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions
