Skip to main content
Solved

How to format a input field to add a 0 in front of single digits?

  • 5 April 2023
  • 5 replies
  • 175 views

Hi everyone, I have designed a acumatica form where the user can select our products from a list, input the weight of our products manually and the report will generate a barcode comprised of the product ID and the weight. Our product IDs are 6 digits, and the barcode reader can process 8 digits, seperating the first 6 digits of product ID from the last 2 digits of product weight. 

How can I format the Net Weight field in the report, so that when the user inputs a single digits; for example, 7, and the program prints 07? Could someone please help me figure it out? Thanks in advance :)

 

5 replies

Badge +12

If I remember correctly, entering =’0#’ in the ‘Format’ field (very first field in your image), should accomplish this.

Userlevel 2

@darylbowman thanks for your suggestion. However, it didn’t seem to work :(

I did put it in the  value field for the net weight input. I wonder if i am doing something wrong

Badge +12

Could you post a screenshot of the properties of that field (like the second image)?

Userlevel 2

Hi @darylbowman, I put the =’0#’ in the ‘Format’ field like you suggested. I am attaching pictures for your reference:

Format field
The output

However, I have just figured out another solution to this. I modified the code to the barcode reader, so my program will separate the product ID and the weight; abolishing the need to do it from the acumatica end! 

Badge +12

Now that I see it, I'm not sure the format works if there is more than just numbers in the field. I believe you can also use the Format( ) method in your formula.

 

But if you found another way, good for you!

Reply