Is it possible to add some extra fields at the top of the Vendor Inventory screen which can be used to filter the grid?
I have been asked if there is a way to have the filters selected for the Default and Item Status set to True and Active by default as this is what the person using this screen has to do each time they open it. I don’t believe it’s possible to alter those fields programatically or get the screen to remember what they were set to.
I thought maybe having the underlying query that the grid uses changed to use values in fields defined at the top might work. I’m not sure how to update the query used for the details for the grid though. Is this possible and are there any examples of how to go about it?
Thanks for any help,
Phil
Page 1 / 1
@ppowell there are a few elements to consider for this request.
I don’t believe it’s possible to alter those fields programatically or get the screen to remember what they were set to.
This is not quite right. You could achieve this by extending the header’s DAC filter and adding those fields. For instance, adding a checkbox as follows:
public class VendorLocationExt : PXCacheExtension<PX.Objects.PO.VendorLocation> { #region DefaultFilter PXBool()] PXUIField(DisplayName="Default Filter")] PXDefault(true, PersistingCheck = PXPersistingCheck.Nothing)] public virtual bool? DefaultFilter { get; set; } public abstract class defaultFilter : PX.Data.BQL.BqlString.Field<defaultFilter> { } #endregion }
And that DAC extension could then get added to the header.
Reviewing the original graph, we can see that the grid’s content is driven by the VendorCatalogue data view. And in this case, you have the advantage that there is not a native delegate associated to that view - which simplifies the redefinition of the view
In a graph extension then, you could redefine the data view as:
Notice the left side of the filter is shown as NULL as opposed to a DB field.
It would appear then that unbounded DAC fields are considered in the logic AFTER the SQL script is run.
I am attaching the customization package as reference. Potentially you could resolve this limitation by defining a delegate for the Data view and managing the IsDefault filter within it
Hi @Fernando Amadoz,
Thanks for this, it was really helpful. I decided to forget adding extra fields and have used your example to limit the screen to just showing active items instead. I wasn't able to filter by IsDefault but as a compromise I set the column to sort descending so the checked ones appear at the top. The user is happy with this solution.