Expand my Community achievements bar.

SOLVED

Joining numeric fields

Avatar

Level 1

I have 3 different numeric fields that represent the branch, account number and verification digit of a bank account

I have also a text field that under a validate event, joins the values of the 3 numeric fields (separated with a "-" and a "/") using the following code

if (BRANCH.rawValue != null && ACCNUM.rawValue != null && VD.rawValue != null ) {

   JOINED_FIELD.rawValue = BRANCH.rawValue  + "-" + ACCNUM.rawValue + "/" + VD.rawValue ;  

}

If I complete the numeric fields with for example

BRANCH=11

ACCNUM=222

VD=3

the joined field shows 11-222/3

but if I complete the BRANCH field with 0, I receive a validation error over JOINED field

Can anybody help me how to avoid the warning message when the Branch selected is 0 ??

Thanks in advance

1 Accepted Solution

Avatar

Correct answer by
Level 10

Move your code to Calculate event of the "JOINED_FIELD" field instead of Validate event.

You are actually calculating the value of the text field based on the values of the 3 Numeric fields.

Thanks

Srini

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

Move your code to Calculate event of the "JOINED_FIELD" field instead of Validate event.

You are actually calculating the value of the text field based on the values of the 3 Numeric fields.

Thanks

Srini

Avatar

Level 1

Srini, your suggestion fixed the problem but I still don´t understand why the code worked for all numbers except when branch number = 0

Could you explain me why the code didn't work under the validate event ?

BIG THANKS for your help

Regards

Spyfox694