Below is code to hide the columns from Available and Selected list box. If all you need is to initialize the columns in Available and Selected list box consider using Acumatica Default Table Layout feature. Note that column configuration is a user configuration so you can initialize the columns but you can't override the user choices after initialization.
To completely remove the columns from the selector you need to redefine the InventoryID selector and explicitly declare the columns you want to see in the second parameter of PXSelector.
You can do so by creating a graph extension on ExpenseClaimDetailEntry
and using CacheAttached
method to redefine the selector:
using PX.Data;
using PX.Objects.IN;
namespace PX.Objects.EP
{
public class ExpenseClaimDetailEntry_Extension : PXGraphExtension<ExpenseClaimDetailEntry>
{
[PXMergeAttributes(Method = MergeMethod.Replace)]
[PXDefault]
[PXUIField(DisplayName = "Expense Item")]
[PXSelector(typeof(InventoryItem.inventoryID),
/* List of available/visible columns go here */
new Type[] { typeof(InventoryItem.inventoryCD),
typeof(InventoryItem.descr) },
SubstituteKey = typeof(InventoryItem.inventoryCD),
DescriptionField = typeof(InventoryItem.descr))]
[PXRestrictor(typeof(Where<InventoryItem.itemType, Equal<INItemTypes.expenseItem>>), Messages.InventoryItemIsNotAnExpenseType)]
protected virtual void EPExpenseClaimDetails_InventoryID_CacheAttached(PXCache sender)
{
}
}
}
