运行在App层的插件
运行在App层的插件 包括操作插件、单据转换插件、反写插件、账表取数插件等,此类插件掌控着某种特定服务的执行过程,与交互界面无关;
实现思路
通过Kingdee.BOS.App.dll的ServiceHelper类获取ViewService服务,调用此服务提供的Load方法
插件准备
插件工程引用Kingdee.BOS.App.dll、Kingdee.BOS.Contracts.dll、Kingdee.BOS.DataEntity.dll
类文件引用相关命名空间,详见示例代码
using Kingdee.BOS.Contracts; using Kingdee.BOS.Core.DynamicForm.PlugIn; using Kingdee.BOS.Core.DynamicForm.PlugIn.Args; using Kingdee.BOS.Core.Metadata; using Kingdee.BOS.Core.SqlBuilder; using Kingdee.BOS.Orm.DataEntity; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace MyOperaionServicePlugIn { public class Class6 : AbstractOperationServicePlugIn { public override void BeforeExecuteOperationTransaction(BeforeExecuteOperationTransaction e) { //加载id为10001的物料数据 //获取ViewService IViewService viewService = Kingdee.BOS.App.ServiceHelper.GetService<IViewService>(); //获取元数据服务 IMetaDataService metadataService = Kingdee.BOS.App.ServiceHelper.GetService<IMetaDataService>(); //获取物料元数据 FormMetadata materialMetada = metadataService.Load(this.Context, "BD_Material") as FormMetadata; //构建过滤条件 QueryBuilderParemeter queryParameter = new QueryBuilderParemeter(); queryParameter.BusinessInfo = materialMetada.BusinessInfo; queryParameter.FilterClauseWihtKey = "FMaterailId = 10001"; //构建快捷过滤条件 OQLFilter filter = new OQLFilter(); filter.Add(new OQLFilterHeadEntityItem() { FilterString = "FMaterialId = 10001" }); //构建关心的字段片段信息 List<SelectorItemInfo> lstSelectorItemInfos = new List<SelectorItemInfo>(); //物料属性 lstSelectorItemInfos.Add(new SelectorItemInfo("FErpClsId")); //使用组织 lstSelectorItemInfos.Add(new SelectorItemInfo("FUseOrgId")); //方法1: DynamicObject[] objs = viewService.Load(this.Context,materialMetada.BusinessInfo.GetDynamicObjectType(),queryParameter); //方法2: objs = viewService.Load(this.Context,new object[] { 10001 },materialMetada.BusinessInfo.GetDynamicObjectType()); //方法3: objs = viewService.Load( this.Context,materialMetada.BusinessInfo,lstSelectorItemInfos,filter); //方法4: objs = viewService.Load( this.Context,"BD_Material",lstSelectorItemInfos,filter); } } }
运行在App层的插件
运行在App层的插件 包括操作插件、单据转换插件、反写插件、账表取数插件等,此类插件掌控着某种特定服务的执行过程,与交互界面无关; 实...
点击下载文档
上一篇:多种消息提示框下一篇:【新手入门】云星空数据字典和数据
本文2024-09-16 17:11:03发表“云星空知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-k3cloud-14072.html
您需要登录后才可以发表评论, 登录登录 或者 注册
最新文档
热门文章