Sum Routing Line table field

Veselin
Member Posts: 19
Hello.
I need to sum a field real time, where center no is M-150.
I need to do it without flowfield.
I make this, but gives me only 0 as result.
Routing Line table -> new field -> Sum M-150 as decimal field
Routing Line table -> new funcition -> SumTotal150
Variables for this funcion -> RoutLine, datatype is record, subtype is Routing Line
Code:
RoutLine.RESET;
RoutLine.SETCURRENTKEY("Routing No.", "Work Center No.");
RoutLine.SETRANGE("Routing No.","Routing No.");
RoutLine.SETRANGE("Work Center No.", 'M-100');
RoutLine.CALCSUMS("Real Time");
Save this result.
I go to my new field Sum M-150 on validate() and place there name of the function like this -> SumTotal150;
Result is everything 0
Where do I make a mistake?
I need to sum a field real time, where center no is M-150.
I need to do it without flowfield.
I make this, but gives me only 0 as result.
Routing Line table -> new field -> Sum M-150 as decimal field
Routing Line table -> new funcition -> SumTotal150
Variables for this funcion -> RoutLine, datatype is record, subtype is Routing Line
Code:
RoutLine.RESET;
RoutLine.SETCURRENTKEY("Routing No.", "Work Center No.");
RoutLine.SETRANGE("Routing No.","Routing No.");
RoutLine.SETRANGE("Work Center No.", 'M-100');
RoutLine.CALCSUMS("Real Time");
Save this result.
I go to my new field Sum M-150 on validate() and place there name of the function like this -> SumTotal150;
Result is everything 0
Where do I make a mistake?
0
Best Answer
-
Classic client:
5
Answers
-
Add a return variable to funtion SumTotal150.
add
exit(RoutLine."Real Time");
as last line of the function.
Put the function SumTotal150 in your page, where you now put the field "Sum M-150".
Set the page field to editable FALSE.
0 -
Some code snipet pls0
-
bostjan.les@gmail.com wrote: »Some code snipet pls
new field Sum M-150
onvalidate field Sum M-150
function
0 -
Do not put the function in onvalidate of the field.
Add the function to the form or page, just like you added the field like this:
0 -
Classic client:
5
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