I've reviewed the other SO questions around enabling custom fields on AR Invoice Entry and GL Journal Transactions
However, in my case, I'm trying to enable a custom field added to the Allocations dialog of AM.30.00.00.
I made an attempt to set the batch as not read-only before trying to enable the row of the grid.
What 'thing' needs to be enabled or made not read-only to facilitate this?
namespace PX.Objects.AM
{
public class MaterialEntry_Extension : PXGraphExtension<MaterialEntry>
{
protected void AMBatch_RowSelected(PXCache cache, PXRowSelectedEventArgs e)
{
var row = (AMBatch)e.Row;
if (row != null)
{
if (!(row.EditableBatch.GetValueOrDefault()))
{
cache.AllowUpdate = true;
Base.batch.Cache.AllowUpdate = true;
PXUIFieldAttribute.SetReadOnly(Base.batch.Cache, null, false);
}
}
}
protected void AMMTranSplit_RowSelected(PXCache cache, PXRowSelectedEventArgs e)
{
var doc = Base.batch.Current;
AMMTranSplit row = e.Row as AMMTranSplit;
var editablebatch = ((AMBatch)doc).EditableBatch.GetValueOrDefault();
if (row != null && doc != null && !(editablebatch))
{
PXUIFieldAttribute.SetReadOnly(cache, row, false);
PXUIFieldAttribute.SetEnabled(cache, row, false);
PXUIFieldAttribute.SetEnabled<AMMTranSplitExt.usrParentSerial>(cache, row, true);
}
}
}}