Amount

Amount form item is a numeric decimal text box which auto-formats the values as per the preferred currency code.



  • Form Items >Data Entry>Amount.



  • To specify the currency code for the value in the Amount item click the SETTINGS pop-up and type the required currency code in the Currency Column as shown in the following image. You can indicate whether the currency code must be prefixed or suffixed by selecting the Prefix Currency or Suffix Currency in the SETTINGS pop-up. You can also add positive (Amount) and negative value (Negative) for an amount.


Adding the Currency symbol for Amount form item

To add the currency symbol for the Amount form item, perform the following steps: 

  1. Specify the appropriate currency format with the relevant Unicode value in the amountformats.xml file present within your application source folder, e.g (D:\SVN_REPO\20.1.10.0\Sources\CTModelHouse\Sources\CTModelHouseResources\src\main\resources\cuser-amountformats.xml), as shown in the following code snippet:

    <format Id = "###,###,###,###,###.###" description = "Indian Currency Format"
            groupSeparator = "," decimalSeparator = "." groupSize = "3" negativeSignPosition = "PREFIX"
            leadingGroupSize = "3" isEnabled = "true" currencySymbol="'\u20b9'"/> <!-- \u20b9 is the Unicode of the Indian Rupee Currency -->
  2. To add the currency symbol for the Amount form item to reflect globally at the application level, ensure that you specify the env option for displaying the currency symbol in the form's listener file, as shown in the following code snippet:

    It is essential that you must make appropriate changes in the FORM_ITEM_DEFINITION table in your Canvas schema, as per the information provided in the third step.

    ct.env.options.form.showCurrencySymbol = true
  3. Specify the appropriate JSON structure of the currency symbol in the APPLICATION_CONFIG column present in the FORM_ITEM_DEFINITION table in the Canvas schema, as shown in the following code snippet: 

    {"currencySymbol":"true"}

    Before you proceed to make changes in the FORM_ITEM_DEFINITION table in your Canvas schema, ensure that you have enabled the Prefix/Suffix Currency option in Settings for the Amount form item in the configured form on Canvas Studio

    The sample DB entries to be provided in the FORM_ITEM_DEFINITION table for adding a currency symbol to the Amount form item are listed as follows:

    In the following example, the provided DB entries are associated with the MySQL database. However, the following listed DB entries are applicable for other databases like Oracle, Postrgre and MSSQL.

    Column Names
    Column Values
    APPLICATION_IDMODELHOUSE
    FORM_IDAMOUNT_FORM
    ITEM_IDAMOUNT_FIELD
    PARENT_IDAMOUNT_FORM
    POSITION1
    ITEM_TYPE2
    DISPLAY_NM_KEY(NULL)
    PLAIN_LBLAmount Field
    LAYOUT(NULL)
    ANCHOR100
    BUNDLE_KEYcommon
    MIN_LENGTH0
    MAX_LENGTH1000
    MAX_NUM_LINES(NULL)
    MAX_CHAR_PER_LINES(NULL)
    TOTAL_COLS(NULL)
    ROW_SPAN(NULL)
    COL_SPAN(NULL)
    VALIDATION_TYPE

    POSITIVE

    RAW_KEYS(NULL)
    RAW_VALUES(NULL)
    INCLUDE_SELECT_INDN
    CONTAINER_INDN
    VISIBLE_INDY
    EDITABLE_INDY
    READ_ONLY_INDN
    REQUIRED_INDN
    LOOKUP_INDN
    COLLAPSIBLE_FIRST_INDN
    DS_VIEW_IND(NULL)
    DS_KEY_COLUMN_ID(NULL)
    DS_VAL_COLUMN_ID(NULL)
    WIDGET_ID(NULL)
    CONDITIONAL_INDN
    CACHE_DATA_INDN
    VALIDATE_ON_SWITCH_INDN
    CRITERIA_ID_REQ_INDN
    CONTEXT_CONTAINER_INDN
    HIDE_LABELN
    MULTI_LANG_INDN
    UPLOAD_FILE_FORMATS(NULL)
    RESIZABLE_INDN
    LINKED_CURR_COL(NULL)
    LABEL_ALIGN_TYPEtop
    APPEND_CURRENCY_MODESUF_CODE
    INITIAL_MULTIPLICITY(NULL)
    PRINT_REQUIRED_INDY
    TOGGLE_INDN
    CHANNEL_IDA
    LABEL_CHAR_COUNT(NULL)
    HELP_ICON_INDN
    COPY_PASTE_INDN
    PRODUCT(NULL)
    SUB_PRODUCT(NULL)
    FUNCTION_CODE(NULL)
    INPUT_ACTION(NULL)
    APPLICATION_CONFIG{"currencySymbol":"true"}
    EVENT_CONFIG(NULL)
    VALIDATION_CONFIG(NULL)
    LOV_CATEGORY(NULL)
    LOV_PARENT_ID(NULL)
    LST_UPD_DT2021-11-01 19:43:22

The following screen shot showcases an amount form item with the currency symbol in the functional application, Modelhouse:



The following table provides information about the properties that are applicable to the Amount form item:




#

Property

Description

Sample Value

1

Form ID

Unique ID of the Form on which you want to place the Form Item.

FORM_TRAN_PURCHINVOICE

2

Item ID

Unique ID to the Form item.
This value is automatically configured once the form is selected from the pop-up window.

AMT_INVOICE

3

Item Type

To identify the item type in a form.

AMOUNT

4

Channel

Assigns the form item compatibility for various devices

All Devices

5

Bundle Key

Name of the key associated with the property file which provides the localized label text for the current form item.
Form item bundle key supersedes the form level bundle key. If this value is blank, form level bundle key will be used to find label keys.

payments

6

Plain Label

Text entered in Plain Label field appears as the label of the form item without the resource bundle key translation.

18.1:

If you are using the property files, leave the Plain Label field as blank.
See About Display Name Key and Plain Label till 18.1 for more details about this property and the related conditions.

Display Name Key is the property-driven label key for the form item. 
See About Display Name Key and Plain Label till 18.1 for more details about this property and the related conditions.

19.1:

In Canvas 19.1, the Display Name Key field is a configuration-driven label key for the form item. 

See About Display Name Key and Plain Label from 19.1 and Managing Display Names for Forms for more information. 


7

Display Name Key

INVOICE AMOUNT

8

Edit

Selected: Renders the Form in edit enabled mode.
De-Selected: Renders the Form in edit disabled mode.

Selected

9

Visibility

Selected: Shows the form item on the Form.
De-Selected: Hides the form item from the form, but the data will still be in active.

Selected

10

Help

Selected: Renders the form item with a help icon.
De-Selected: Renders the form item without a help icon.
Refer the Configuring Help Messages and Tooltips for Form Items section for more information on configuring help text.

Selected

11

Anchor

Defines the size of the form item in terms of percentage (without % symbol).

50

12

Print

Selected: Allows printing the form item while printing the form.
De-Selected: Does not print the particular form item while printing the form.

Selected

13

Column Span

Occupies the specified number of item spaces horizontally for the current item.

2

14

Label Alignment

Indicates the alignment of the labels of the form items.
Select Options: Left (  ) or Top () or Inline ( )

Top

15

Hide Label

Selected: Hides the label of the form item.
De-Selected: Shows the label of the form item.

De-Selected

16

Mandatory

Selected: Shows the red asterisk ({}{*}) on the label of the form item, and converts the particular field as mandatory.
De-Selected: Considers the particular field as non-mandatory.

Selected

17

Conditional Mandatory

Selected: Shows the blue double asterisks ({}{}) on the label of the form item, and converts the particular field as conditional mandatory.
Note: If selected, write the conditional logic in the CFEC.PRE_VALIDATE event. See Form Item Handlers for more information.
De-Selected: considers the particular field as normal.
If 'Mandatory' is already selected, do not select this property.

De-Selected

18Add Icon

By making use of Add Icon option, you can add an icon to the form item. Perform the following steps for adding an icon to a form item: 
  1. Clickicon to add an icon to the field. By default, the Left option gets selected, which paves the way for the icon to get placed on the left side of the form item's label, whereas if the option Right is chosen, then the icon gets placed on the right side of the form item's label. 




  2. Clickicon to choose an icon for the form item.  




  3. Icons and Custom are the two available tabs. From the list of icons in Font Awesome, you can choose an icon of your choice. Click Search text field and type the name of the icon, which you wish to choose.  




  4. Default, Active, Disabled and Error are the four available options, categorized under the field, Choose icons for different state. You can assign separate icons for the four different states of Default, Active, Disabled and Error. Default indicates the default icon of the form item, whereas Active and Disabled depict the active and disabled states of the form item. When the selected form item is active, the chosen icon for Active state gets displayed and similarly, the icon, chosen for Disabled state, gets displayed, if the form item is in a disabled state. When an error occurs, the icon, which was selected for Error, gets displayed. 




  5. To add a customized icon, click Custom tab.  




  6. Click Browse Files button to select an image from your local drive. You can even drag and drop the customized image file directly, without any fuss. 




    The customized image appears under the category of Custom Images

    If you upload a customized icon for the form item, ensure that you restart the app server, after saving the form. Make sure to log out from Canvas Studio and close the Studio application, before restarting the app server. If you do not restart the app server, the uploaded custom icon will not appear as the assigned icon for the selected form item.



De-Selected
19

Minimum Input Size

Indicates the minimum number of characters within the text controls.

3

20

Maximum Input Size

Indicates the maximum number of characters within the text controls.

6

21

Multilingual input allowed

Selected: Supports the multilingual characters to be entered into the form items.
De-Selected: Supports only the default language (English).

-

22

Switch

Enables you to switch from one form item to another form item along with the applicable properties and their values. To switch from one form item to another form item, execute the steps that follow:

  1. Select the form item in the form designer area.
  2. Click the Switch icon (  ) on the primary ribbon.
  3. Select another form item to switch the existing form item.

NA

23

Clone

Enables you to create a duplicate of the selected form item along with its applicable properties except for the Item ID.

2

24Event Wiring

The Event Wiring option enables you to assign various events for different set of actions. For detailed information on Event Wiring, refer Form Items Event Wiring.  


By default, the Amount form item allows only digits and decimal as input.