AI OnAI Off
Hi - yes, for now OrderContext.Search is your best bet. We are working on search using abstraction APIs (IOrderSearch), however it is still a long way ahead.
Sounds like you can search for orders that contains items from a specific supplier by this
var searchParameters = new OrderSearchParameters();
//other things
searchParameters.SqlWhereClause= $" OrderGroupId in (SELECT OrderGroupId From LineItem li INNER JOIN LineItemEx lie ON li.LineItemId = lie.ObjectId WHERE lie.Supplier = {supplier}) ";
//Search
Two notes:
Hi,
Usually, you have the screnario where "Company X" sells to n numbers of customers. When loading a customers orders, you do:
_orderRepository.Load<IPurchaseOrder>(customerId);
However, in our solution, we need to support n numbers of suppliers selling to n numbers of customers. One order can contain articles from different suppliers. Loading the customers orders we can do as above, however, I'm not sure what strategy to take to load the all orders related to a supplier.
Currently, a reference to the supplier is stored on the line item in commerce.
Does anyone have any input, tips or trix in regards to a good solution to extract orders related to one specific supplier? I came across the "OrderSearchOptions", would that be a good option?
Thanks!
/Jessica