public IEnumerable records() { SalesPriceFilter filter = this.Filter.Current; if (filter != null) { PXSelectBase <SOSalesPrice> select = new PXSelectJoin <SOSalesPrice, InnerJoin <InventoryItem, On <SOSalesPrice.inventoryID, Equal <InventoryItem.inventoryID> > >, Where <SOSalesPrice.curyID, Equal <Current <SalesPriceFilter.curyID> > > >(this); if (!string.IsNullOrEmpty(filter.InventoryPriceClassID)) { select.WhereAnd <Where <InventoryItem.priceClassID, Equal <Current <SalesPriceFilter.inventoryPriceClassID> > > >(); } if (filter.InventoryID != null) { select.WhereAnd <Where <SOSalesPrice.inventoryID, Equal <Current <SalesPriceFilter.inventoryID> > > >(); } return(select.Select()); } else { return(null); } }
protected virtual void SalesPriceFilter_RowSelected(PXCache sender, PXRowSelectedEventArgs e) { Records.Cache.AllowInsert = false; Records.Cache.AllowUpdate = false; Records.Cache.AllowDelete = false; SalesPriceFilter row = e.Row as SalesPriceFilter; if (row != null && row.CuryID != null) { Records.Cache.AllowInsert = true; Records.Cache.AllowUpdate = true; Records.Cache.AllowDelete = true; } if (Setup.Current.AlwaysFromBaseCury == true) { PXUIFieldAttribute.SetEnabled <SalesPriceFilter.curyID>(sender, e.Row, false); } }