采购收料单 写入报错
//参考代码,未实际运行,注意按需要修改
//获取销售订单的元数据
int BILLID = 0;
FormMetadata meta = MetaDataServiceHelper.Load(this.Context, "PUR_ReceiveBill") as FormMetadata;
//业务元数据BusinessInfo
BusinessInfo info = meta.BusinessInfo;
//获取表单服务商
IResourceServiceProvider formServiceProvider = meta.BusinessInfo.GetForm().GetFormServiceProvider(true);
IBillViewService billViewService = formServiceProvider.GetService(typeof(IDynamicFormView)) as IBillViewService;
/******创建单据打开参数*************/
Form form = meta.BusinessInfo.GetForm();
BillOpenParameter billOpenParameter = new BillOpenParameter(form.Id, meta.GetLayoutInfo().Id);
billOpenParameter = new BillOpenParameter(form.Id, string.Empty);
billOpenParameter.Context = CT;
billOpenParameter.ServiceName = form.FormServiceName;
billOpenParameter.PageId = Guid.NewGuid().ToString();
billOpenParameter.FormMetaData = meta;
billOpenParameter.LayoutId = meta.GetLayoutInfo().Id;
billOpenParameter.Status = OperationStatus.ADDNEW;
billOpenParameter.PkValue = null;
billOpenParameter.CreateFrom = CreateFrom.Default;
billOpenParameter.ParentId = 0;
billOpenParameter.GroupId = "";
billOpenParameter.DefaultBillTypeId = null;
billOpenParameter.DefaultBusinessFlowId = null;
billOpenParameter.SetCustomParameter("ShowConfirmDialogWhenChangeOrg", false);
List
billOpenParameter.SetCustomParameter(FormConst.PlugIns, value);
//初始化视图
((IDynamicFormViewService)billViewService).Initialize(billOpenParameter, formServiceProvider);
//表单视图
IBillView bill_view = (IBillView)billViewService;
bill_view.CreateNewModelData();
提示与单据插件冲突了,这个要怎么处理,把插件去掉?
DynamicFormViewPlugInProxy proxy = bill_view.GetService
proxy.FireOnLoad();
推荐阅读