Posted: 2017-01-20 in Numeric

Q: How do I display the actual number without having it being rounded? a numeric database value being displayed in a canvas textbox.
If the value saved is 523.65, the displayed value is 524.

My form section has calculated fields whose values are computed based on records in other tables
May I know where should I put code to perform the actual calculation and to refresh the calculated values when records in those tables are changed?
Any field in a form section that has an expression as its data source is automatically a calculated field. It will be calculated and displayed any time you navigate data.
Look at the section and field attributes and you will find attributes that tell Lianja to recalc and redisplay calculated fields automatically as you perform data entry.
Also, grids can have calculated columns as well as horizontal and vertical totaling and subtotaling with conditional color coding of the grid cells.
My calculation in this case is complex
Can the expression call a server procedure in server too using Lianja.Evaluate()?
Yes. The data source can be a function call which is executed on the server. Just remember that in a web / mobile app, this is a client / server architecture so the server knows nothing about the context of what you are doing on the client. You should therefore substitute data context as parameters to the remote function call using {…} macros or else call a client side javascript function that builds the parameters up and the uses Lianja.evaluate() to make the remote function call.

Added a new field (form and canvas sections) attribute “Recalculate”. When data is entered into a field interactively any readonly or calculated fields are automatically recalculated and re-displayed. This is typically used to calculate totals e.g. if you have three columns; Quantity,Price,Cost and “Cost” is calculated by quantity*price, then as you change either quantity or price the “Cost” field will be recalculated and refreshed.



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s