(7.10) Searching orders and organizations / database queries

Vote:
 

Hello

I need to customize the purchase order list in Commerce Manager. The default views list order ID, customer name, order total and status. Adding new fields to the view seems to be as easy as editing Orders-List.xml - if the new fields are also on the purchase order. I'm not so lucky.

Here's my problem: I need each order list row to contain additional meta field information about the organization the customer who placed the order belongs to. How do I do this?

So far I've figured out how to create a custom replacement for OrderList.ascx.cs, where I can theoretically control what data gets fed to the order list. But I can't figure out how to actually make any kind of query that returns rows with information from both the purchase order, and the organisation of the customer who placed the order. I can make joins in the SQL query, but that seems like it only helps me filtering among PurchaseOrders. I'm still asking the OrderContext to give me a collection of PurchaseOrders. Which, of course, won't include any of the Organization data in the result.

In Commerce, how do you get the kind joined data results I need out of a database query?

#118345
Mar 04, 2015 16:21
Vote:
 

Hi,

You just want the organization's name or more information required?

If it's just organization name then you might add a metafield to PurchaseOrder and set it to the name when you save your order.

Regards.

/Q

#118348
Mar 04, 2015 16:59
Vote:
 

No, it's also a few metafields we've added to Organization. 

#118351
Mar 04, 2015 17:22
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.