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 fieldRouting Line table -> new funcition -> SumTotal150Variables for this funcion -> RoutLine, datatype is record, subtype is Routing Line
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?
What Datatype is "Real Time". What version of Dynamics? and have you tried CALCFIELDS("Real Time" ) instead?
Depending of your NAV version the CALCSUMS only works if you on you key "Routing No.", "Work Center No.") - have added a SUM-field to the index.
You should take a look at the Customer table and one on of the flowfields and then the corresponding Customer Ledger Entry.The question you are asking is very basic, and you could take a look at the NAV 2013 Training material C/Side Introduction. It will speed up your learning curve dramatically.
Real Time is DecimalNavision 2009 R2Calcfields still not working
Where you are saving the result and how?
Everything is in table Routing Line
Could you paste 3 records into this message. Because you are doing something basically wrong and just to verify that you have the data correctly
seems you are calsuming but not saving - do what Palle Arentoft suggested
Take a look at this example
CustLedgerEntry.RESET;CustLedgerEntry.SETCURRENTKEY("Customer No.","Posting Date","Currency Code");CustLedgerEntry.SETRANGE("Customer No.",'10000');CustLedgerEntry.CALCSUMS("Sales (LCY)");MESSAGE(FORMAT(CustLedgerEntry."Sales (LCY)"));
- The sortingkey used has a SUMINDEXFIELD
Besides you wrote M-150 but your code says
RoutLine.SETRANGE("Work Center No.", 'M-100');
my new field in Routing LineMy function in Routing LineField Sum M-100 OnValidate()
Look at example Palle suggested. Still cant figure out where you are saving the value there is no code for it. You are not doing anything with returned value even it is calculated correctly. I believe you are trying to save values to Sum M-100 field onvalidation? so if you vaildate on this field for all four records you will have sames value in each record. does not seem to be efficient and logical unless you have other plans with it.