Hi,
I want to create a list page showing purchase lines (T39) from orders and return orders.
If the record's Document Type=Order, the field Quantity should be shown as default, but if the Document Type=Return Order, the field Quantity should be shown with inverted sign (e.g. Quantity=4 would be shown as -4 and vice-versa). I don't want to change the data, and I don't want to calculate the data on the page because this would prevent the users from sorting and filtering the data afterwards.
So, I was wondering, if I can acheive this by the use of the AutoFormatExpr-property on the page column.
I have tried to create a AutoFormatExprText string variable and set it to '-<Standard Format,0>' in the OnAfterGetRecord, if Document Type=Return Order and Quantity > 0, and then set the AutoFormatExpr=AutoFormatExprText on the column Quantity (AutoFormatType=10). That didn't work.
I am coding in NAV 2017. Any suggestions?
BR Emerik
0
Answers
Create a System.Decimal variable. DOTNET type in mscorlib, call it SystemDecimal.
Call the Negate function with your value as parameter.
NegativeDecimal := SystemDecimal.Negate(PositiveDecimal);
Or use it directly in SourceExp.
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
Otherwise assign the returnvalue to a decimal variable.
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
I always replace the value in the table :-)
But the function work.