Solved

How to make a check box default to checked?

  • 30 December 2021
  • 4 replies
  • 425 views

Userlevel 1

Is it possible to default check boxes as checked? For example, in the Kit Specification (ScreenId=IN209500) the Allow Component Addition box and the Allow Component Qty Variance boxes default as unchecked. My client always has to check these. I want to make them default to checked. I’m guessing this is going to require a customization but was hoping otherwise. What would that customization look like?

icon

Best answer by Naveen Boga 30 December 2021, 19:22

View original

4 replies

Userlevel 7
Badge +17

Hi @mylescarroll22  You can achieve this with small piece of code to check the “Allow Component Addition” field by default as checked. Here is the code attached for your reference.

 public class INKitSpecMaint_Extension : PXGraphExtension<INKitSpecMaint>
{
#region Event Handlers

[PXMergeAttributes(Method = MergeMethod.Merge)]
[PXDefault(true,PersistingCheck =PXPersistingCheck.Nothing)]
protected virtual void INKitSpecHdr_AllowCompAddition_CacheAttached(PXCache cache)
{
}

#endregion
}

 

Userlevel 1

Thanks Naveen

Userlevel 7
Badge +17

@mylescarroll22  Also, I have created a customization package, you can deploy in your instance and verify.

 

Userlevel 1

Thank you, Naveen, that seems to work fine in my test environment for Allow Component Addition. Is it possible to make the Allow Component Qty Variance box to default to checked when adding a new row on the same page? Thanks. 

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