Skip to main content

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);
}}

 

Ironically, when I read your post, the first ‘Related Topics’ shown to the right of your question was this:

See if that helps.

Edit: that post mostly covers making UDFs available.

Otherwise, when you need to make a field in the cache editable, you also need to make the cache editable first.

cache.AllowUpdate = True;

https://asiablog.acumatica.com/2021/10/enable-customization-fields-when-document-is-completed.html

 


@orlandonegron43,

The approach will be that, you need to enable the field in the workflow extension and in the graph extension. In the graph extension, use the RowSelected event of the DAC in which you have custom field. Feel free to post back if you have any questions. 


Ironically, when I read your post, the first ‘Related Topics’ shown to the right of your question was this:

See if that helps.

Edit: that post mostly covers making UDFs available.

Otherwise, when you need to make a field in the cache editable, you also need to make the cache editable first.

cache.AllowUpdate = True;

https://asiablog.acumatica.com/2021/10/enable-customization-fields-when-document-is-completed.html

 

It worked!, Thank you so much for your assitance.


@orlandonegron43,

The approach will be that, you need to enable the field in the workflow extension and in the graph extension. In the graph extension, use the RowSelected event of the DAC in which you have custom field. Feel free to post back if you have any questions. 

It worked, Thank you


Would anyone be able to give me insight on how to accomplish this on the “cleared” field and “clearedDate” field for AP.30.20.00? I’ve been able to do this for a custom field on the AP Invoice screen but it does not seem to work the same for AP Checks. 

I’ve tried the below without luck

 

 

This is what I have on the invoice entry screen which works (along with the edited workflow). 
 

 

Any suggestions would be very appreciated.


@rmarschall - you should create a new question for your query.

But, looking at the picture of the source code, you’ve included two field attributes on lines 53 and 54 that shouldn’t be there.  Those two are to decorate field declarations, not methods.


@Django 

That actually helped for one of the 2 screens i’m trying to accomplish this. i’m going to continue to tweak the code and see if i can get it to work before posting a new question. I appreciate your help!


Reply