如何在插件中通过代码反审核单据
金蝶云社区-云小爱
云小爱
0人赞赏了该文章 2,120次浏览 未经作者许可,禁止转载编辑于2014年02月12日 11:35:56

已知单据内码,对单据进行反审核:
var auditSvr = Kingdee.BOS.Contracts.ServiceFactory.GetSetStatusService(ctx);
long lPKID = 100047;
var keyValueIds = new List>();
var kv = new KeyValuePair(lPKID, 0);
keyValueIds.Add(kv);
var retAudit = auditSvr.SetBillStatus(ctx, formMeta.BusinessInfo, keyValueIds, new List() { 0, "" }, "UnAudit");

以上代码出现如下错误:

Exception rethrown at [0]:
在 Kingdee.BOS.ServiceHelper.BusinessDataServiceHelper.SetBillStatus(Context ctx, BusinessInfo businessInfo, List`1 pkEntryIds, List`1 paras, String operationNumber, OperateOption option)
在 Kingdee.BOS.Business.Bill.Operation.AbstractStatusConvert.ExecuteBillOperation(List`1 paras, OperateOption option)
在 Kingdee.BOS.Business.Bill.Operation.AbstractStatusConvert.ExecuteStatusConvert(List`1 paras)
在 Kingdee.BOS.Business.Bill.Operation.UnAudit.UnAuditIdeaPrompt()
在 Kingdee.BOS.Core.DynamicForm.AbstractDynamicFormOperation.Operation(CallBackWfAfterOperation callbackwf, IOperationResult result)
在 Kingdee.BOS.Core.DynamicForm.AbstractDynamicFormOperation.Execute(InvokeFormOperation4WfParam param, CallBackWfAfterOperation callbackwf)
在 Kingdee.BOS.Web.DynamicForm.OperationCaller.InvokeFormOperation(String operationNumber)
在 Kingdee.BOS.Business.DynamicForm.BusinessService.ExcuteOperation.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.DynamicWebFormView.BarItemClick(String parentKey, String barItemKey, BarDataManager bar, Int32 bartype)
在 Kingdee.BOS.Web.DynamicForm.DynamicWebFormView.MainBarItemClick(String barItemKey)
在 Kingdee.BOS.Web.DynamicForm.DynamicWebFormController.MainBarItemClick(String itemKey, JSONArray postDatas)
错误数据: System.Collections.ListDictionaryInternal