SugarCRM detailview使用子面板数据计算字段

I have two custom modules that have a one-to-many relation ship A->B I'm trying to calculate field at editview for module A "total price", based on all "price" (sum) of subpanel for module B.

It's is possible to do in detailview, not using logichooks

In the Studio, open the field(total price) of module A whose value you want to update, add a calculation formula. In the formula editor, select rollup. You can select the rollup type as Sum, your module B and the field in module B whose sum is to be populated in total price.