Hello experts,
There is a field Promised On (Expected Date) on Purchase Orders screen (PO301000) and it is set to Today by default

I am trying to set default value of this field null and I have used the following approach:
- Set default value to null in event handler FieldDefaulting:
using PX.Data;
namespace PX.Objects.PO
{
public class POOrderEntry_Extension : PXGraphExtension<POOrderEntry>
{
#region Event Handlers
protected void POOrder_ExpectedDate_FieldDefaulting(PXCache cache, PXFieldDefaultingEventArgs e)
{
var row = (POOrder)e.Row;
if (row != null)
{
e.NewValue = null;
e.Cancel = true; // If I don't use e.Cancel = true, it still doesn't work
}
}
#endregion
}
}
- override Initialize method:
public class POOrderEntryExt : PXGraphExtension<POOrderEntry>
{
public override void Initialize()
{
base.Initialize();
PXUIFieldAttribute.SetVisible<POOrder.expectedDate>(Base.Document.Cache, null, false);
PXDefaultAttribute.SetPersistingCheck<POOrder.expectedDate>(Base.Document.Cache, null, PXPersistingCheck.Nothing);
PXDefaultAttribute.SetDefault<POOrder.expectedDate>(Base.Document.Cache, null);
}
}
but none of these solution could work. The value of field ExpectedDate is still set to Today.
Do you know is it possible to set default value of field ExpectedDate to null?
Thanks you for your help.