问题描述
我知道pxformula可以做到,但是pxformula仅接受两个参数参数。如何添加(求和)同一DAC的多个字段?我可以嵌套吗?
I know pxformula could do it, but pxformula only accepts two argument parameters. how can i add (sum) multiple fields of the same DAC? can i nest it?
谢谢。
推荐答案
如另一个答案中所建议,可以使用PXFormula执行多字段计算。但是,PXFormula始终将计算值分配给它装饰的字段。
As suggested in another answer, PXFormula can be used to perform a multi field calculation. However, PXFormula always assigns calculated value to the field it decorates.
如果您不需要在任何字段中存储计算值,PXUnboundFormulaAttribute可能是一个更好的方法:
PXUnboundFormulaAttribute might be a better approach in case you don't need to store calculated value in any field:
[PXUnboundFormulaAttribute(typeof(Switch<Case<Where<GLTranDoc.debitAccountID, IsNotNull>, GLTranDoc.curyTranTotal>, Sub<GLTranDoc.curyTaxAmt, GLTranDoc.curyInclTaxAmt>>),
typeof(SumCalc<GLDocBatch.curyDebitTotal>))]
有关PXUnboundFormulaAttribute的其他示例,请检查示例7.3:添加汇总值的条件计算,网址为或
For additional examples on the PXUnboundFormulaAttribute, please check Example 7.3: Adding Conditional Calculation of Aggregated Values in the T200 developer class guide at Acumatica University or Acumatica Open University
这篇关于如何在Acumatica(pxformula)中求和多个字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!