Hello there,
i have text field storing the Decimal Value, date type is int(decimal).
I wrote the validation where the dollar amount cannot exceed 100 Billion Dollars.
First, I have added $99,999,999,999.00 to the field, then no validation message thrown --> Valid.
second, i have added $9,999,999,999,999.00 without refreshing the page, then validation Message thrown ---> valid.
third, i have modified it to $99,999,999,999.00 without refreshing, then validation still exists which should be gone.
I do not understand where the issue is. Please guide if i am missing anything?
a!textField( label: cons!MSP_LBL_DOLLAR_AMOUNT, value: rule!ACO_dollar( ri!request.dollarAmount, true ), saveInto: { local!dollarAmount, a!save( ri!request.dollarAmount, todecimal( save!value ) ) }, showWhen: rule!MSP_dollarAmountFieldVisibility( ri!request ), required: true, validations: if( and( not( rule!ACO_isBlank(ri!request.dollarAmount)), ri!request.requestTypeId = cons!MSP_ID_REQUEST_DATA_TYPE_CONDUCT_WIRE_DISBURSEMENTS), if( len( local!dollarAmount ) > 12, if( like( local!dollarAmount, "100000000000.00" ), null, "Dollar amount must be within 100 Billon Dollars.", ), null ), null ) ),
Discussion posts and replies are publicly visible
I don't think I'd use the len() function to validate against this - in this case you have 12 digits, but the text value could be longer if it includes the dollar sign, decimal digits, etc. Can you just compare the decimal representation directly to $100B like this?
validations: { if( ri!request.dollarAmount > 100000000000.0, "Validation Message", null ) }
Hello Peter,
I tried the same and in addition i converted the text value to decimal value on Value parameter and saved it in a local variable ,then i passed it under validation then worked.
Thanks a lot for the reply though!