Hello all
I am trying to perform a customization change. I want to enable the Inventory ID with stock item selector values only , when GL Module is selected for Jorunal Transaction Screen.
Below is my code.
public class JournalEntry_Extension :PXGraphExtension<JournalEntry>
{
#region Event Handlers
public static bool IsActive() => true;
protected void _(Events.RowSelected<Batch> e)
{
if (e.Row == null) return;
if (e.Row.Module == "GL")
{
PXUIFieldAttribute.SetEnabled<GLTran.inventoryID>(e.Cache, e.Row, true);
}
}
PXMergeAttributes(Method = MergeMethod.Merge)]
PXSelector(typeof(Search<InventoryItem.inventoryCD>),
typeof(InventoryItem.inventoryCD),
typeof(InventoryItem.descr),
SubstituteKey = typeof(InventoryItem.inventoryCD))]
public int? InventoryID { get; set; }
public virtual void GLTran_InventoryID_CacheAttached(PXCache sender)
{
}
#endregion
}
The above code enable the lines . I want to enable only the field value on type GL.
Appreciate reply. Thank you.