Get parent object in Microflow

0
Hi there, I have an Order + OrderLine model. In OrderLine i need a Microflow to calculate the count of all lines from that order. I want to do things ‘On commit’ on OrderLine level. How can i get the Order object in a MF when i put only the OrderLine parameter in the MF ? Or is there another way to access the Order when in OrderLine detail? Is possible, please share a screenshot. Many thanks in advance.
asked
3 answers
1

Very likely order-orderline has a 1-* association. In your order line's ‘On commit’ microflow, you can use the activity ‘Retrieve’ over this association, passing Orderline as a parameter and receiving one order object.

Next, do a Retrieve of orderlines passing the order object.

Next, do an Aggregate List → Count, and you have your number of orderlines of the order to which your orderline belongs.

answered
0

Hi Tim,

Is the first Retrieve ‘by association’ ? Order stays empty after the first Retrieve action. So the count is always 0.

answered
0

Ok, it makes more sense now. I use the microflow as an event handler when adding an orderline. See screenshot. How do i get the order object here? 

 

 

answered