You are doing math with your calculation, not a CONCATENATION.
When I am working with numeric data, that is not used for math, i.e. zip codes, social security numbers or part numbers, I treat them as Text fields. Then leading zeroes are not dropped.
I kind of understand what you mean.
The account reference is already a text field, im guessing its something to do with the way I've set the variable? Which is treating it as a number on line 22?
How can I change it so that it preforms a find on "DOD02" instead of "DOD2" which it currently does? This will then make sure that when an account reference is found it will store it as "DOD3" etc etc
Number + "01"
adds the values
Number & "01"
And if you have two or more users doing this at the same time, please note that it's possible to get duplicate values here. It's much safer NOT to generate this kind of ID but to rely on either an auto-entered serial number or UUID value.
But perhaps you need this value for SAGE. If so, then at least put a unique values validation on this field to catch the rare circumstance of getting a second record with the same value.
You also do not actually need to use a loop to get the numeric part of the ID.
Oh yeh I have a unique value validation setup.
How can I iterate through the 'numbers' for the numeric part of the string?
Look at the "SerialIncrement" function. it keeps the zeros.
Cheers, never knew this function existed
"How can I iterate through the 'numbers' for the numeric part of the string?"
count the number of matches and add 1.