Solved

Available Fields when document is released


Userlevel 2

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

 

icon

Best answer by Django 3 May 2024, 20:52

View original

4 replies

Userlevel 7
Badge +5

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

 

Userlevel 7
Badge +4

@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. 

Userlevel 2

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.

Userlevel 2

@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

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