Skip to main content
Solved

How to make a check box default to checked?

  • 30 December 2021
  • 4 replies
  • 546 views

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?

Best answer by Naveen Boga

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
  }

 

View original
Did this topic help you find an answer to your question?

4 replies

Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3381 replies
  • Answer
  • December 30, 2021

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
  }

 


Thanks Naveen


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3381 replies
  • December 30, 2021

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

 


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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings