Display a Description Next to a Field in a Form (showFieldDescription)

In some cases, application form designers need to show descriptive text for values.

This happens in cases like currency fields, where the rules for what currency is being used are complex and application-dependent.

For instance, for fields in organizational budget currency (e.g. amount_income with afm_flds.numeric value of “Budget Currency”) the Budget Currency (e.g. USD) comes from the BudgetCurrency application parameter.

For fields in payment currencies (e.g. amount_income_payment with afm_flds.numeric value of “Payment Currency”), the currency type comes from another field ( payment_currency with AFM Type = “Payment Currency”) in the same record, which field validates against the Archibus Currencies table. However, the user may change this payment currency value (e.g. from EUR to YEN) while editing the record.

The logic is somewhat intricate (e.g. the business logic of the form must calculate not only the Budget Currency values but also the VAT Tax values from the Payment Currency) and is best implemented with the application code that controls currency. Yet the application code needs a way to place the currency text description beneath the numeric currency value.

To do so, use the formController’s showFieldDescription ( <field control name>, textValue ) to add a description text (e.g. currency or unit symbol) as a red label in a numeric field.

Example:

http://localhost:8080/archibus/schema/ab-products/solutions/parts/form/ab-ex-form-panel-select-value.axvw

var formController = View.createController('formController', {
afterInitialDataFetch: function()
var fieldDef = this.formPanelSelVal_form.getDataSource().fieldDefs.get("wr.cost_total");
var currencyTxt = fieldDef.currency;
if(currencyTxt == 'USD'){
currencyTxt = "US Dollars (" + currencyTxt + ")";
}else if(currencyTxt == 'EUR'){
currencyTxt = "Euros (" + currencyTxt + ")";
}

The Form example with Custom Select Value Dialogs ( \schema\ab-products\solutions\parts\form\ab-ex-form-panel-select-value.axvw ) Technologies example illustrates this method.

form_show_desc.JPG