Solved

Recording whole number without decimal in a field

  • 30 September 2022
  • 3 replies
  • 186 views

Hello all,

 

Is there a way to make in input field that currently takes decimal number to take only a whole number?  We have a few fields that are only used to record output quantity and scrap.  To reduce errors i would like to remove decimal places as we would never scrap part of something.  example We output 16 we scrap 3. 

Thank for any help you can provide.

icon

Best answer by deybanperez83 30 September 2022, 22:14

View original

3 replies

Userlevel 5
Badge +1

Hi @jmeagher, You have used PXDBDecimalAttribute for those fields in the DAC, correct me if I’m wrong. If so, then use PXDBIntAttribute instead PXDBDecimalAttribute. This should resolve your issue. 

 

Since you are changing the datatype you have to write a script to change the DataType from Decimal to Int in the DB as well. 

Userlevel 3

Yes, you can define the PXDecimal attribute of the field in the following way:
 

[PXDBDecimal(0)]

 

The PXDBDecimal attribute constructor has a parameter called Precision, you can use it to define how many decimals you want to display in the interface and how many decimals you want to handle when using that field. The precision must be <= than the defined in the DB Schema.

 


Ex.

Before:

[PXDBDecimal(2)]



After:
 

[PXDBDecimal(0)]

 




 

Thank you both for responding to my thread, I am trying to learn more and more of the customizations I can do to help the company I work for. 

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved