Skip to main content



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. 
 

Hi, @vramkrishna26 Below is the source code to enable the Inventory ID field at the GRID level in the Journal Transactions screen.

 


public class JournalEntry_Extension : PXGraphExtension<JournalEntry>
{
public static bool IsActive() => true;

protected void _(Events.RowSelected<GLTran> e)
{
GLTran row = e.Row as GLTran;
if (row != null && Base.BatchModule.Current != null)
{
PXUIFieldAttribute.SetEnabled<GLTran.inventoryID>(e.Cache, row, Base.BatchModule.Current.Module == BatchModule.GL);
}
}
}

 

 


Reply