Solved

how to initialize the field checkbox by default true?

  • 3 March 2021
  • 2 replies
  • 1073 views

I created a new field and I want to initialize by default true
Thanks for your help.

icon

Best answer by Hughes Beausejour 3 March 2021, 23:07

View original

2 replies

Userlevel 5
Badge +2

For database bound field (PXDBBool) add PXDefault attribute to the DAC field declaration:
[PXDefault(true)]

For unbound field (PXBool) add PXUnboundDefault attribute instead:
[PXUnboundDefault(true)]

Example:
#region IsActive
public abstract class isActive : PX.Data.BQL.BqlBool.Field<isActive> { }
[PXDBBool()]
[PXDefault(true)]
[PXUIField(DisplayName = "Active")]
public virtual bool? IsActive { get; set; }
#endregion

Solved. thank you very much.

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