Solved

Make custom fields editable on Journal Transaction details

  • 5 November 2023
  • 3 replies
  • 50 views

Userlevel 6
Badge +3

@Naveen Boga solved this problem for me before on the SO Lines grid

However, that was to enable native fields.  I’m using the same logic to try to enable two custom fields on the GL entry details, but I am unable to make them editable.

I’ve added what I think is the necessary code and changes to the workflow.  

 

namespace PX.Objects.GL
{
public class JournalEntry_Extension : PXGraphExtension<PX.Objects.GL.JournalEntry>
{
#region Event Handlers

protected void GLTran_RowSelected(PXCache cache, PXRowSelectedEventArgs e, PXRowSelected InvokeBaseHandler)
{
if(InvokeBaseHandler != null)
InvokeBaseHandler(cache, e);
var row = (GLTran)e.Row;

if (row != null)
{
//Allowing caches to update with below code
Base.BatchModule.Cache.AllowUpdate = true;
Base.GLTranModuleBatNbr.Cache.AllowUpdate = true;

GLTranExt glExt = PXCache<GLTran>.GetExtension<GLTranExt>(row);
PXUIFieldAttribute.SetEnabled<GLTranExt.usrLoan>(cache, row, true);
PXUIFieldAttribute.SetEnabled<GLTranExt.usrALE>(cache, row, true);
}
}



#endregion
}
}

Data is being saved to the DB, so there is nothing wrong with the fields:

I’ve no idea why this isn’t working.  It is almost a copy/paste from the solution from Naveen for SO Lines.

I’ve attached a copy of the project if anyone wants a closer look.

icon

Best answer by Naveen Boga 6 November 2023, 04:10

View original

3 replies

Userlevel 7
Badge +17

@Joe Schmucker  Hope you are doing well.

Yes, Acumatica made few changes at GL transactions level. Can you please try with below code and confirm?

namespace PX.Objects.GL
{
public class JournalEntry_Extension : PXGraphExtension<PX.Objects.GL.JournalEntry>
{
#region Event Handlers

protected void GLTran_RowSelected(PXCache cache, PXRowSelectedEventArgs e, PXRowSelected InvokeBaseHandler)
{
if(InvokeBaseHandler != null)
InvokeBaseHandler(cache, e);
var row = (GLTran)e.Row;

if (row != null)
{
//Allowing caches to update with below code
Base.BatchModule.Cache.AllowUpdate = true;
Base.GLTranModuleBatNbr.Cache.AllowUpdate = true;

GLTranExt glExt = PXCache<GLTran>.GetExtension<GLTranExt>(row);
PXUIFieldAttribute.SetEnabled<GLTranExt.usrLoan>(cache, row, true);
PXUIFieldAttribute.SetEnabled<GLTranExt.usrALE>(cache, row, true);

PXUIFieldAttribute.SetReadOnly<GLTranExt.usrLoan>(cache, null, false);

PXUIFieldAttribute.SetReadOnly<GLTranExt.usrALE>(cache, null, false);

}
}



#endregion
}
}

 

Userlevel 6
Badge +3

Removed this comment.  Not needed!

 

Userlevel 6
Badge +3

PLEASE DISREGARD THAT LAST POST.  I was working with the WRONG workflow item!

Thanks again Naveen.

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