hougaard / Simple-Object-Designer

Issue tracking for the Simple Object Designer for Business Central
7 stars 0 forks source link

Calculated Field Divided By Zero #230

Closed Pfc-JoeH closed 1 year ago

Pfc-JoeH commented 1 year ago

Apologies if this is a bit too basic a question but I'm wondering if it is possible to create a calculated field expression that would be something along the lines of: IF(Rec.CustomQtyField <>0, Rec.Price / Rec.CustomQtyField).

hougaard commented 1 year ago

Not right now... But it's in the works to have calculated fields survive division by zero and other cases of blank values...

Pfc-JoeH commented 1 year ago

Any nonsensical expressioning I might be able to make work like adding back in a certain amount or something?

hougaard commented 1 year ago

Well, you can add 0.0000001 to the number before you divide (and take advantage of the result only being shown with 2 decimals) :)

hougaard commented 1 year ago

Rec.Price / (Rec.CustomQtyField + 0.000000001)

Pfc-JoeH commented 1 year ago

I tried it with just a .1 before and I guess because there wasn’t a leading 0 it got upset. This issue can close for now but if it’s possible to have calculated fields survive divided by zero, that would be awesome!

hougaard commented 1 year ago

Yeah, .1 is not a valid number in source code :)