Dear All experts,
There is always a pop message windows said: "division by zero. 0/0" if I try to change unit cost per field in the production order routing line. If I used debugger it shows (in the red arrow) these coding (table # 5407) of expected quantity (on validate) field:
...
IF (Status IN [Status::Released,Status::Finished]) AND
(xRec."Item No." <> '') AND
("Line No." <> 0)
THEN
CALCFIELDS("Act. Consumption (Qty)");
"Remaining Quantity" := "Expected Quantity" - "Act. Consumption (Qty)" / "Qty. per Unit of Measure";
...
If I delete the codings, what I want to do is work good. Also if I don't delete them but delete this coding in the table # 5409 of field unit cost per:
...
CalcStartingEndingDates(Direction::Forward);
...
I have been trying to solve it but not succeed good. Could you give me some solutions for the problems ??
I set the items and all relevant fields manually and standard costing, no inventory exists. Thanks in advance for your answers. I expect them a lot.
Rgds,
Mark
0
Comments
"Remaining Quantity" := "Expected Quantity" - "Act. Consumption (Qty)" / "Qty. per Unit of Measure";
whith this:
IF "Qty. per Unit of Measure" <> 0 THEN
"Remaining Quantity" := "Expected Quantity" - "Act. Consumption (Qty)" / "Qty. per Unit of Measure"
ELSE
"Remaining Quantity" := "Expected Quantity";
OR just populate "Qty. per Unit of Measure" field
Hope this helps
Regards
My world: Dynamics NAV,SQL and .NET
CEO at Solving Dynamics
http://www.solvingdynamics.com
Tks for youranswer but I will write the overall codings firsts:
So, I am afraid if the substitute will influence another, nevertheles I will try then.
Rgds,
I didn't check, so please forgive me if I'm wrong, but I think it's better if you look if your Unit of Measure conversions for that Item, WorkCenter etc. are all right.
RIS Plus, LLC
So check 2 things firstly is the field properties for this table set to 1, second how was the table filled.
If it is set to 1, then how were these values input, the only way it could be Zero, is if the value set to zero either created in code or dataported in without an validate or table.INIT on the record.
Mobile: +44(0)7854 842801
Email: david.cox@adeptris.com
Twitter: https://twitter.com/Adeptris
Website: http://www.adeptris.com
RIS Plus, LLC
See this Code from #5407
Item No. - OnValidate()
~
Item.TESTFIELD("Base Unit of Measure");
VALIDATE("Unit of Measure Code",Item."Base Unit of Measure");
~
This calls
Unit of Measure Code - OnValidate()
~
"Qty. per Unit of Measure" := UOMMgt.GetQtyPerUnitOfMeasure(Item,"Unit of Measure Code");
"Quantity (Base)" := CalcBaseQty(Quantity);
~
So it looks like the line was filled without validating the Item No., or you have bad data in the "Item unit of Measure" Table #5404, which will not allow a zero Quantity Per., this field has init = 1 and not blank = yes, but that only works if data is entered by hand, you can dataport rubbish into tables, so always validate the fields, the same sequence as manual input, that will trap errors!
End of Investigation ! :roll: "I must get out more!" :?
Mobile: +44(0)7854 842801
Email: david.cox@adeptris.com
Twitter: https://twitter.com/Adeptris
Website: http://www.adeptris.com
Why do you have to get out more?
//Range Check Error
It's 10:30 pm in the UK, and I am looking at Navision, in the evening after looking at it all day! ](*,)
Mobile: +44(0)7854 842801
Email: david.cox@adeptris.com
Twitter: https://twitter.com/Adeptris
Website: http://www.adeptris.com
Tks for your replies/answers.
I actually suing this coding from Andreof:
It works but another database can work without the new coding that supposed by Andreof.
The things that I don't understand that I have another database, but it can works good, there is no. problem, regarding your replies, I will check item's unit of measure, item no., and work center / machine center.
Rgds,
Mark
Moreover the code:
insert an error (it doesn't consider the consumption if you don't set "Qty. per Unit of Measure").
You must "solve" and not "workaround" the problem, this time.
And my candidate... obviously Dataport