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.
Best answer by Naveen Boga
View original