Good day,
I have a situation in Checks and Payments screen with my custom fields, I need these fields to be available even after the release of the document, I have tried with events, overriding the persist method, and overriding the release, but nothing is working and the fields always become readonly, I would appreciate suggestions to solve this.
Here I am adding examples of how I am trying to enable the fields with the events or overriding the Release.
public class APPaymentEntry_Extension : PXGraphExtension<PX.Objects.AP.APPaymentEntry>
{
protected virtual void _(Events.FieldUpdated<APPayment.status> e)
{
if (e.Row != null)
{
PXUIFieldAttribute.SetEnabled<APRegisterExt.usrChkMailDate>(e.Cache, e.Row, true);
PXUIFieldAttribute.SetEnabled<APRegisterExt.usrChkPickupDate>(e.Cache, e.Row, true);
}
}
public delegate IEnumerable ReleaseDelegate(PXAdapter adapter);
PXOverride]
public virtual IEnumerable Release(PXAdapter adapter, ReleaseDelegate baseMethod)
{
var doc = Base.Document.Current;
if (doc != null)
{
PXUIFieldAttribute.SetEnabled<APRegisterExt.usrChkMailDate>(Base.Document.Cache, doc, true);
PXUIFieldAttribute.SetEnabled<APRegisterExt.usrChkPickupDate>(Base.Document.Cache, doc, true);
}
return baseMethod(adapter);
}}