Agile Developer

Formulae in fields

Axpert 11
TStructs (Forms)
Axpert Jobs
Axpert Cards
HTML Plug-ins
Users & Roles
Axpert API
Application Var/Params
Publish Axpert Apps
Axpert Mobile

Formulae in fields

A formula can be assigned to any field in Axpert. A formula for a field is assigned in the expression property. The formula will be evaluated and assigned as the field value at run time. All fields in this tstruct/form that are before this field can be used as variables in the formula. The operators + – * / ^ ( ). { are used as quotes in Axpert. So, to use a constant string, enclose the string between { }. For example, a string hello in an expression is set as {Hello}. The list of functions that can be used in Axpert is available in the Axpert functions section.
Example: Consider a form that contains below fields

  • ItemName
  • ItemType
  • SellingRate
  • SaleQuantity
  • DiscountPercent – This should be populated with 3% if ItemType=A and SaleQuantity> 5 or ItemType=B and SaleQuantity> 100
  • SaleAmount – This should be based on calculation

Formula for DiscountPercent :
iif( ((ItemType={A}) & (SaleQuantity>5)), 3, iif((ItemType={B} &SaleQuantity>100), 5, 0))

Formula for SaleAmount :
(SellingRate*SaleQuantity) – (((SellingRate*SaleQuantity)*DiscountPercent)/100)

For more information on Axpert Functions check General Functions section.

Try Out