【二开插件】插件隐藏过滤方案
单据有三个过滤方案,希望强制删除过滤方案“aa”,可二开插件实现,实现步骤如下:
1、二开插件代码
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args; using Kingdee.BOS.Core.List.PlugIn; using Kingdee.BOS.Core.List.PlugIn.Args; using Kingdee.BOS.Core.ListFilter; using Kingdee.BOS.Util; using System; using System.Linq; namespace TestPlugin { /// <summary> /// 此插件注册到 “列表过滤(带组织)”(BOS_OrgIsolationFilter) /// </summary> [HotUpdate] public class MyListFilterPlugIn : AbstractListFilterPlugIn { public override void FireBeforeBindFilterMetadata(EventArgs e) { var listFilterModel = this.Model as Kingdee.BOS.Model.ListFilter.ListFilterModel; var schemeList = listFilterModel.GetAllSchemeList(); var removeSchemes = schemeList.Where(r => r.SchemeName == "aa").ToList(); removeSchemes.ForEach(r => schemeList.Remove(r)); } public override void ButtonClick(ButtonClickEventArgs e) { base.ButtonClick(e); } } /// <summary> /// 此插件注册到 “业务单据模板”(BOS_BusinessBillModel) /// </summary> [HotUpdate] public class MyListPlugIn : AbstractListPlugIn { public override void PrepareFilterParameter(FilterArgs e) { var field = this.ListModel.GetType().GetProperty("ListFilterModel", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance); var listFilterModel = field.GetValue(this.ListModel) as Kingdee.BOS.Model.ListFilter.ListFilterModel; var schemeList = listFilterModel.GetAllSchemeList(); var removeSchemes = schemeList.Where(r => r.SchemeName == "aa").ToList(); removeSchemes.ForEach(r => schemeList.Remove(r)); } } }
2、扩展单据 【列表过滤(带组织)】(BOS_OrgIsolationFilter),注册二开插件
3、扩展单据“业务单据模板”(BOS_BusinessBillModel),注册二开插件
4、运行效果如下图:
【二开插件】插件隐藏过滤方案
单据有三个过滤方案,希望强制删除过滤方案“aa”,可二开插件实现,实现步骤如下:1、二开插件代码using Kingdee.BOS.Core.DynamicForm.Pl...
点击下载文档
本文2024-09-16 18:28:01发表“云星空知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-k3cloud-22328.html
您需要登录后才可以发表评论, 登录登录 或者 注册
最新文档
热门文章