ShowForm打开单据详情/单据列表,如何进行传参以及参数获取
1、应用场景
不少二开场景中,均需要ShowForm打开对应单据的单据详情或是单据列表界面,同时需要将当前单据特定字段值或是变量,传递到目标单据上,借由表单或是列表插件进行读取,从而进行相关的计算或是赋值。
本文将演示跨单之间如何进行参数值的传递及获取。
2、案例演示
币别打开物料详情界面,传递自定义参数至物料界面,物料表单插件获取该参数后进行展示。
币别打开物料列表界面,传递自定义参数至物料界面,物料列表获取该参数后进行展示。
3、示例代码
币别表单插件,ShowForm打开物料详情及物料列表示例代码:
using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Text; using Kingdee.BOS.Core.Bill; using Kingdee.BOS.Core.Bill.PlugIn; using Kingdee.BOS.Core.DynamicForm.PlugIn.Args; using Kingdee.BOS.Core.List; using Kingdee.BOS.Util; namespace Running.Sample.PlugIn.BusinessPlugIn.Bill { [Description("测试ShowForm传参"), HotUpdate] public class P20240102ShowFormEdit : AbstractBillPlugIn { public override void BarItemClick(BarItemClickEventArgs e) { //打开单据详情 if (e.BarItemKey.EqualsIgnoreCase("tbBtnEdit")) { BillShowParameter showParam = new BillShowParameter(); showParam.FormId = "BD_MATERIAL"; showParam.PKey = "100462"; //传递自定义参数 showParam.CustomParams.Add("TestShowParamEdit", "1"); this.View.ShowForm(showParam); } //打开单据列表 else if (e.BarItemKey.EqualsIgnoreCase("tbBtnList")) { ListShowParameter showParam = new ListShowParameter(); showParam.FormId = "BD_MATERIAL"; //传递自定义参数 showParam.CustomParams.Add("TestShowParamList", "2"); this.View.ShowForm(showParam); } } } }
物料表单插件,获取币别传递过来的自定义参数:
using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Text; using Kingdee.BOS.Core.Bill.PlugIn; using Kingdee.BOS.Util; namespace Running.Sample.PlugIn.BusinessPlugIn.Bill { [Description("测试参数读取,表单插件"), HotUpdate] public class P20240102GetCustomParamsValueEdit : AbstractBillPlugIn { public override void AfterBindData(EventArgs e) { object res = this.View.OpenParameter.GetCustomParameter("TestShowParamEdit"); this.View.ShowMessage(string.Format("自定义参数,参数标识 TestShowParamEdit 的对应值是:{0}", res.GetString())); } } }
物料列表插件,获取币别传递过来的自定义参数:
using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Text; using Kingdee.BOS.Core.List.PlugIn; using Kingdee.BOS.Util; namespace Running.Sample.PlugIn.BusinessPlugIn.List { [Description("测试参数读取,表单插件"), HotUpdate] public class P20240102GetCustomParamsValueList : AbstractListPlugIn { public override void AfterBindData(EventArgs e) { object res = this.View.OpenParameter.GetCustomParameter("TestShowParamList"); this.View.ShowMessage(string.Format("自定义参数,参数标识 TestShowParamList 的对应值是:{0}", res.GetString())); } } }
ShowForm打开单据详情/单据列表,如何进行传参以及参数获取
1、应用场景 不少二开场景中,均需要ShowForm打开对应单据的单据详情或是单据列表界面,同时需要将当前单据特定字段值或是变量,传递到...
点击下载文档
上一篇:老白学开发笔记-webapi下一篇:过滤界面中,隐藏页签的三种方法
本文2024-09-16 18:28:11发表“云星空知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-k3cloud-22345.html
您需要登录后才可以发表评论, 登录登录 或者 注册
最新文档
热门文章