Skip to main content

Good day,

I need to build PXSelector BQL to get all vendors for current sales order. Something like

PXSelector(typeof(Search2<Vendor.bAccountID, InnerJoin<PO.POVendorInventory,
                On<PO.POVendorInventory.vendorID, Equal<Vendor.bAccountID>
                    , And<PO.POVendorInventory.inventoryID, In<SOLine.inventoryID>>>>>)

Hi @hotdok  I Hope you wanted to load all the active vendors if I’m not wrong. If yes, you can use like below.

 

#region VendorID
public abstract class vendorID : PX.Data.BQL.BqlInt.Field<vendorID> { }
/// <summary>
/// Identifier of the <see cref="Vendor"/>, whom the document belongs to.
/// </summary>
/VendorActive(
Visibility = PXUIVisibility.SelectorVisible,
DescriptionField = typeof(Vendor.acctName),
CacheGlobal = true,
Filterable = true)]

public virtual int? VendorID
{
get;
set;
}
#endregion

 


Thanks for reply. But I wanted differents stuff. As I wrote I need get all vendors for exact sales order. I need PXSelector attribute for extension property declaration. This property should return list of all vendors for opened sales order.


Figured out myself. This is how it works for me

[PXSelector(typeof(Search2<Vendor.bAccountID, InnerJoin<PO.POVendorInventory,
                On<PO.POVendorInventory.vendorID, Equal<Vendor.bAccountID>>>
                    , Where<PO.POVendorInventory.inventoryID, In2<Search<SOLine.inventoryID, Where<SOLine.orderNbr, Equal<Current<SOOrder.orderNbr>>>>>>>)
 


Thank you for sharing your solution with the community @hotdok!


Reply