Hi experts!!
AV2018
I need that in a field if it has value -9999.999 automatically put blank because this is my null value.
In table this value is like InitValue, I thought I would take it as 0 and with the property blankzero = yes it would be solved but it does not take it as zero and it appears
In NAV2009 I had a function (in the form onformat) for this but in Nav2018 I need help please
-1
Answers
If numbers allowed in your field are non-negative (0 or bigger) you could use BlankNumbers property and set it to BlankNeg
If the field is supposed to display all negative, zero, and positive numbers, and only this one specific value -9999.999 is supposed to be hidden then you need to write a bit of the code to manage it - a function or two - depending if the field is supposed to be editable or not.
If the field is non-editable then you would only need one function, like this: You could use this function directly in SourceExpr property:
If however you need to keep the field editable then you would need to created global text var on the page, assign the var to the SourceExpr property, in OnAfterGetCurrRecord trigger set the value of the field using SomeGlobalTextVar := BlankMyNullValue("my field"), and in OnValidate you would need another line of code to interpret what user typed in the field and assign it back to your field.
The drawback is that once you start using code to manage displayed values you will lose the possibility of sorting along that field.
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
the initial value of the field in the table is -9999.9999, when a record is inserted this is the default value, the field is editable, and in some cases another value (decimal) will be set and in some cases it will not. (same as blankzero when the Initvalue = 0)
What I need is that when the field has the default value it appears blank, without having to go through the field but it is editable for when the value has to be changed.
Your second example it is not valid because it does not respect the decimals; they are calculation data for a laboratory and the decimals must be very precise
Anyway, I need the data -9999.9999 not to appear without having to go through the field.
Thank you so much for everything