The 3 digits are part of an identification number that we match with a string in payments.
The original UD field was an integer, so it stripped the leading zeros. Integers treat “012” as “12”, and save it as “12”.
I created a new UD field of string type, formatted to x(3), and it works as intended.
Setting the field mask to 999 didn’t work. Guessing because that’s for numbers, not strings… A co-worker also gave me the following code to restrict the data entry to digits only, which was added to the form: