Solved

Increase decimal length past 6

  • 8 January 2022
  • 5 replies
  • 443 views

Userlevel 3
Badge +1

I am wondering if anyone has had any luck increasing the decimal length higher than 6 (Acumatic's OOB limit)?

icon

Best answer by Naveen Boga 8 January 2022, 07:16

View original

5 replies

Userlevel 7
Badge +19

Hi @asmith50  In Acumatica, OOB we can not provide the decimals more than 6.

If you wanted increase the decimals more than 6 decimal, it requires small piece of customisation.

I just worked on this customisation and hope this helps you. 

Please find the source code for your reference.

 

 public class OrganizationMaint_Extension : PXGraphExtension<OrganizationMaint>
{
[PXMergeAttributes(Method = MergeMethod.Merge)]
[PXRemoveBaseAttributeAttribute (typeof(PXDBShortAttribute))]
[PXDBShort(MinValue = 0, MaxValue = 10)]
public virtual void CommonSetup_DecPlPrcCst_CacheAttached(PXCache sender)
{
}
}

 

 

 

This is pretty cool!  @Naveen B I had to increase the size of the DB field manually for it to use the additional decimal places.  Is this something you ran into as well?  I feel like you would need to modify a lot of the db schema to be decimal(23, 10) for this to work everywhere.  I really love how Acumatica just goes along with the higher precision! 

 

Just running with Naveen’s idea, you can do the same thing for Qty:

        [PXMergeAttributes(Method = MergeMethod.Merge)]
[PXRemoveBaseAttributeAttribute (typeof(PXDBShortAttribute))]
[PXDBShort(MinValue = 0, MaxValue = 10)]
public virtual void CommonSetup_DecPlQty_CacheAttached(PXCache sender)
{
}

 

Userlevel 7
Badge +19

Yes @wyattERP  That is correct. We need to modify the database field to increase Precision for the required fields.

Userlevel 3
Badge +1

@Naveen B Your customer worked great. @wyattERP when I was attempting to increase the Quantity Decimal Places I could not get the field to accept anything over 6 characters. Any ideas? Do I need to add the two public virtual void lines together?

 

using PX.Objects;
using PX.Objects.CS;

namespace PX.Objects.CS
{
  public class OrganizationMaint_Extension : PXGraphExtension<OrganizationMaint>
  {
        [PXMergeAttributes(Method = MergeMethod.Merge)]
        [PXRemoveBaseAttributeAttribute (typeof(PXDBShortAttribute))]
        [PXDBShort(MinValue = 0, MaxValue = 10)]
        public virtual void CommonSetup_DecPlPrcCst_CacheAttached(PXCache sender)
        public virtual void CommonSetup_DecPlQty_CacheAttached(PXCache sender)
        {
        }
        #region Event Handlers

    #endregion
  }
}

Userlevel 7
Badge +19

Hi @asmith50  I can able to add more than 6 characters. Please find the code and screenshots for reference.

using PX.Data;

namespace PX.Objects.CS
{
public class OrganizationMaint_Extension : PXGraphExtension<OrganizationMaint>
{
[PXMergeAttributes(Method = MergeMethod.Merge)]
[PXRemoveBaseAttributeAttribute(typeof(PXDBShortAttribute))]
[PXDBShort(MinValue = 0, MaxValue = 10)]
public virtual void CommonSetup_DecPlQty_CacheAttached(PXCache sender)
{
}
#region Event Handlers

#endregion
}
}

 

 

 

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