Validation

Hi ,

I have one scenario that where 

if the value is not 0 and the values should not round off and it should accept up to 9 decimals like 3.612232423.

 

Minimum Rate: 3.5

Maximum Rate: 4

 

input value is of number(dec) format i mean CDT has this data type, how can we achieve this if user enters any values apart from the scenario mentioned above should not except.

 

Thanks in advance.

  Discussion posts and replies are publicly visible

Parents Reply
  • ok ,Here I have sample code 

    a!textField(
                            align: "RIGHT",
                            required: ri!isActive_bool,
                            value: rule!CR_FN_setDecimalValues(
                              value_dec: fv!item.tariffAmountProposed_dec,
                              decPlace_int: 9
                            ),
                            validations: if(
                              fv!item.tariffAmountProposed_dec = 0,
                              {},
                              if(
                                fv!item.tariffAmountProposed_dec >9,
                                "Value must be less than or equal to 9",
                              if(
                                fv!item.tariffAmountProposed_dec < 3.5,
                                "Value must be greater than or equal to 3.5",
                                if(
                                  fv!item.tariffAmountProposed_dec > 4,
                                  "Value must be less than or equal to 4",
                                  ""
                                )
                              )
                              )
                            ),
                            saveInto: { fv!item.tariffAmountProposed_dec },
                            disabled: ri!isReadOnly_bool
                          )

    Validation provided like this where if user enter more than 9 decimals validation is not coming up and value is not rounding off,How can I achieve those above validations if user enters any other format validation should throw. 

Children