Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
1797 Tampilan

Hello, 

I would like to search for an order by the values on the order lines. As an example lets say I would like to search by the "Unit Price" field on the sales order line. How would we do that? 

Avatar
Buang
Penulis Jawaban Terbai

This can be done via studio and a little bit of XML. You would have to be in developer mode for this. 

1) The first step would be to make sure you have an auto-created studio inherited view for your search view. If you do not have one then simply drag and drop an existing field on the Auto Complete section. This should create the required view needed along with the XPath as well. 



2) Next Step would be to remove that field from the XML code and add your required field. In this example we we would like to search by the unit price so this is how it would look: 


In this case, the name of the field we are referring to first is "order_line" and then we would like to search the order lines for another specific subfield. In this case, it is Unit Price and this is done by the filter_domain function where we are referring to the subfield order_line.price_unit. 

We can use this same syntax to search for another field that you require from the Sale Order Line. The main change here would be the subfield: order_line.fieldfromsaleorderline

3) Once saved, you can test it by going to your sales order list view and searching for the unit price. As an example, I have searched for orders that contain lines where the unit price is $100.00. So this is how it would look: 

Please Note: The decimal places are important for this field so make sure to search it by including the decimal places. So 100 in this case would be 100.00. But this can vary from field to field. 

Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
2
Mei 25
4422
1
Apr 25
1204
2
Okt 24
3949
1
Sep 24
3602
1
Sep 24
2406