Solved

BQL get all vendors by all items in sales order

  • 6 February 2024
  • 4 replies
  • 42 views

Userlevel 2
Badge

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>>>>>)

icon

Best answer by hotdok 20 February 2024, 05:37

View original

4 replies

Userlevel 7
Badge +17

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

 

Userlevel 2
Badge

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.

Userlevel 2
Badge

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>>>>>>>)
 

Userlevel 7
Badge

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

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved