Divison By zero error
ayamas
Member Posts: 15
Hi guys,
I have a problem.I am new to navision development.I hv designed a report.When I run that report on the 107th page I get a error Division by zero.I dont think its practical to debug it.
Can anyone please tell me how can i handle the error & whats the exact syntax to do it.
Thanks in advance.
I have a problem.I am new to navision development.I hv designed a report.When I run that report on the 107th page I get a error Division by zero.I dont think its practical to debug it.
Can anyone please tell me how can i handle the error & whats the exact syntax to do it.
Thanks in advance.
0
Comments
-
Why wouldn't it be practical to debug? Debugger active, but Breakpoint on Triggers off?
Handling the error, I'm afraid, involves not dividing by zero!
Kind regards,
Jan Hoek
Product Developer
Mprise Products B.V.0 -
No the problem is in my report I am displaying the GP(%) of an item.But there are some items whose purchase price is zero I mean suppliers give it for free for ex (on 10 pieces 1 piece free) at tat time I get this error.0
-
If your problem is that the division was entered as the SourceExpr of a report control, consider replacing the SourceExpr with a call to a function that returns the GP% both in normal (purchase price <> 0) and exceptional cases (purchase price = 0).Kind regards,
Jan Hoek
Product Developer
Mprise Products B.V.0 -
so make it that you never divide by zero, that's not a difficult thing to do.
IF y = 0 THEN y := 1; SomeValue := x/y;
orIF y = 0 THEN ErrorMsg := 'GP is zero' ELSE SomeValue := x/y;
something like that. Be creative
0 -
I'm having the same problem ( the division by zero error ).
In some languages there's an infinitesimal value that we can use to solve those kinds of problems, i.e.:
instead of:
y=x/z
we use:
y=x/(z+min)
min is the infinitesimal value.
Does navision has a function/constant anything that returns the minimum value that the system accepts?0 -
nope. And I wouldn't use this solution in navision.0
-
if z = 0 is works fine.
What I mean is, the developer will should catch the division by zero.
if they are missing it now in their code, they will still miss adding (min) in their code.0 -
Yes, ara3n is right, we should maintain the standards of navision. Problem of division by zero may be avoiding by storing the value in a variable and run the output where is not equal to zero. This is the best way to deal with this error.Mukesh Sharma0
-
Muksha
It appears you agree with me a lot.
http://www.mibuso.com/forum/viewtopic.php?t=11694&highlight=0 -
The interesting thing is that if you ask a mathematician, he will say division by zero is a wrong operation, it should not yield a value but if you ask an accountant, he will say it should return 0.
If you don't have any sales, sales price etc. then the profit is obviously 0 - so code it this way.0
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
- 611 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 253 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


