Difficulty with Variables in different entities

0
Hi All, This is something that I haven't been able to figure out or wrap my head around. There's 3 modules, sales, billing and products that relevant here. From sales I do a quote, on the quote I add an orderline(from billing) and orderline gets the info from products. Now in a microflow i want to set the value for example Cost price to (orderline cost = product cost * quantity.) <-------- this is really giving me sleepless nights. I can use change item billing.orderline_products to get here: $OrderLine/CostPriceExVat = $OrderLine/Billing.OrderLine_Products/ But there is nothing to choose then... If I add the parameter products then i get what i want but i'm sitting with errors saying it only needs one parameter. I've ran into this scenario many times and normally after giving up I find a "dirty" work around but for this one there is none. Is there anyone that could explain what I'm missing in the big picture so I can solve this and future occurrences. Thank You,
asked
1 answers
0

It seems like an orderline is associated to a list of products (reference set) instead of one product (reference). If that is the case you'll need to iterate the list to do your calculation.

If it's associated to one product through a reference you can just retrieve the product from the orderline and do your calculation

answered