I’m trying to override a data view used in Stock Items and Non-Stock Items screens, and in the abstract InventoryItemMaintBase graph class -- the view named itemxrefrecord that is used in the Cross-Reference tab grid. The view, like most in this base class, uses FbqlSelect and SelectFromBase instead of just SelectFrom (see definition below). This graph class seems to be the only one in the framework that uses this syntax for some reason (at least that’s what I’ve seen from a quick code search).
public FbqlSelect<SelectFromBase<INItemXRef, TypeArrayOf<IFbqlJoin>.Empty>.Where<PX.Data.ReferentialIntegrity.Attributes.KeysRelation<PX.Data.ReferentialIntegrity.Attributes.Field<INItemXRef.inventoryID>.IsRelatedTo<InventoryItem.inventoryID>.AsSimpleKey.WithTablesOf<InventoryItem, INItemXRef>, InventoryItem, INItemXRef>.SameAsCurrent>, INItemXRef>.View itemxrefrecords;
This syntax uses a lot of keywords that would take a long time to decipher enough to add a second join condition, so I tried to override it with typical SelectFrom syntax instead (see below). I just want to add a join to BAccount to grab the Vendor name.
public SelectFrom<INItemXRef>
.InnerJoin<InventoryItem>.On<INItemXRef.inventoryID.IsEqual<InventoryItem.inventoryID>>
.InnerJoin<BAccount>.On<INItemXRef.bAccountID.IsEqual<BAccount.bAccountID>>
.Where<INItemXRef.inventoryID.IsEqual<InventoryItem.inventoryID.FromCurrent>>.View itemxrefrecords;
It worked to get the Vendor name showing in the grid, but when testing it and attempting to add a row in the grid and save, it fails with the “Another process has added the INItemXRef record”. Any guidance on how to override the original existing FbqlSelect data view to add a join, or how to resolve the error in my SelectFrom version? I can probably extend the DAC and add a calculated field to resolve it so that I don’t need a join, but it seemed like the join was a simpler solution -- if it would work.