K3Cloud 根据单据ID 获取单据视图和数据包

Posted jlz-s

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了K3Cloud 根据单据ID 获取单据视图和数据包相关的知识,希望对你有一定的参考价值。

//根据ID获取单据,然后正常修改单据。

技术分享图片
 1 private object GetSalDeliveryNotictView(long billFid)
 2 {
 3     if (this.formMetaData == null)
 4     {
 5         this.formMetaData = (FormMetadata)MetaDataServiceHelper.Load(base.Context, "SAL_DELIVERYNOTICE", true);
 6     }
 7     BusinessInfo businessInfo = this.formMetaData.BusinessInfo;
 8     Form form = businessInfo.GetForm();
 9     IResourceServiceProvider formServiceProvider = form.GetFormServiceProvider(false);
10     BillOpenParameter billOpenParameter = new BillOpenParameter("SAL_DELIVERYNOTICE", null);
11     billOpenParameter.SetCustomParameter("formID", "SAL_DELIVERYNOTICE");
12     billOpenParameter.SetCustomParameter("pk", billFid);
13     billOpenParameter.SetCustomParameter("status", "EDIT");
14     billOpenParameter.SetCustomParameter("PlugIns", businessInfo.GetForm().CreateFormPlugIns());
15     billOpenParameter.Context = base.Context;
16     billOpenParameter.FormMetaData = this.formMetaData;
17     billOpenParameter.LayoutId = billOpenParameter.FormMetaData.GetLayoutInfo().Id;
18     billOpenParameter.PkValue = billFid;
19     billOpenParameter.Status = OperationStatus.EDIT;
20     object service = formServiceProvider.GetService(typeof(IDynamicFormView));
21     (service as IBillViewService).Initialize(billOpenParameter, formServiceProvider);
22     (service as IBillView).OpenParameter.Status = OperationStatus.EDIT;
23     (service as IBillViewService).LoadData();
24     (service as IBillView).CommitNetworkCtrl();
25     return service;
26 }
View Code

 

以上是关于K3Cloud 根据单据ID 获取单据视图和数据包的主要内容,如果未能解决你的问题,请参考以下文章

转K3Cloud 二次开发 单据转换系列

金蝶K3cloud单据作废如何删除?

K3cloud 动态表单中,调用其它单据的套打模板

K3CLOUD核算单据查询异常语句

自定义方法实现单据数据过滤

SAASERP-采购订单-历史单据总结