Make Pxdefault As Not Required For Input

Make PXDefault as not required for input

Hello everybody,

Imagine following situation, you added to your DAC field some default value. For example like this:

[PXDBDate]
[PXDefault(typeof(AccessInfo.businessDate))]
public virtual DateTime? FromDate

And now you have default value as current date. But what, if you don't like to make it required for input. How to achieve this goal? The answer is quite simple, you just need to add PersistingCheck = PXPersistingCheck.Nothing into pxdefault attribute. Like this:

[PXDBDate]
[PXDefault(typeof(AccessInfo.businessDate), PersistingCheck = PXPersistingCheck.Nothing)]
public virtual DateTime? FromDate

With such changes you can init your values at form, and make it not required for input

No Comments

Add a Comment
Comments are closed