Accessing Quote Fields with Logic Hooks

Hi there,

reposting this here, as it is relevant for SuiteCRM too I guess.

When saving a quote one can easily access standard fields like “name” using “$bean->name” to process it further in an after_save hook.

Trying to get hold of the products_quote fields seems a bit trickier.

What’s the most efficient way to e.g. calculate the total quantity of all product of the order?
As of now I am using a mysql query
"SELECT SUM(product_qty) as total FROM aos_products_quotes WHERE parent_id = ‘{$bean->id}’
which is only working once the quote has been saved already.
Even though it is triggered by an after_save hook!

I would like to have that number when the quote is being created initially.

I did try to get the numbers using:
“aos_products_quotes_product_qty” - to no avail so far.

Any hints/directions?