【已解决】多个单据体字段sum 汇总到单据头字段
金蝶云社区-论坛ID_629989
论坛ID_629989
1人赞赏了该文章 2,033次浏览 未经作者许可,禁止转载编辑于2016年03月31日 10:16:26

我在保存的前面加一个服务,计算定义公式的值并填写到指定列单据头字段 = sum(单据体字段1) + sum(单据体字段2) + sum(单据体字段3)

这样没有问题

但是需求是单据体字段变更的时候用值更新事件更新到单据头字段

然后我给单据体字段加值更新事件 跟上面的服务一样
然后就报错了。


[{"operation":"e87fa2b549ef4a2c88beb79e1c39c835.UpdateValue"}]
发生时间:10:12:52
错误来源: IronPython
错误信息:Decimal is not iterable
===================================================
调用堆栈:
在 IronPython.Runtime.Operations.PythonOps.GetEnumerator(CodeContext context, Object o)
在 IronPython.Modules.Builtin.sum(CodeContext context, Object sequence, Object start)
在 IronPython.Modules.Builtin.sum(CodeContext context, Object sequence)
在 Microsoft.Scripting.Interpreter.FuncCallInstruction`3.Run(InterpretedFrame frame)
在 Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
在 Microsoft.Scripting.Interpreter.LightLambda.Run4[T0,T1,T2,T3,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3)
在 System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)
在 Microsoft.Scripting.Interpreter.DynamicInstruction`4.Run(InterpretedFrame frame)
在 Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
在 Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1)
在 IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx)
在 IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Scope scope)
在 Kingdee.BOS.Scripting.PyExpressionEvaluator.Run(Expression expression, ExpressionContext context)
在 Kingdee.BOS.Business.DynamicForm.BusinessService.Calculate.DoAction(FormBusinessServiceArgs e)
在 Kingdee.BOS.Core.DynamicForm.FormBusinessServiceUtil.InvokeServices(IDynamicFormView view, Object source, IEnumerable`1 services, Int32 actionType, String activeEntity, DynamicObject activeRow, Int32 rowIndex)
在 Kingdee.BOS.Web.DynamicForm.BusinessServiceCaller.InvokeFormBusiness(IDynamicFormView view, Object source, List`1 formBusinessServices, Int32 actionType, String entityKey, Int32 row)
在 Kingdee.BOS.Web.DynamicForm.BusinessServiceCaller.CallUpdateBusinessService(FieldAppearance fieldAppearance, Int32 row)
在 Kingdee.BOS.Web.DynamicForm.DynamicWebFormView.UpdateValue(String key, Int32 row, Object value)
在 Kingdee.BOS.Web.Bill.BillView.UpdateValue(String key, Int32 row, Object value)
在 Kingdee.BOS.Web.DynamicForm.DynamicWebFormController.UpdateValue(String key, Object value, Int32 row, JSONArray postDatas)
错误数据: System.Collections.ListDictionaryInternal

用BOS可以直接完成吗