Python脚本实现单据体首行过滤

编写的Python脚本
单据体首行过滤.PNG 
可以看到,实际代码只有3句,即实现单据体首行过滤代码(其实最最主要的是无需写组件动态即时注册),
并有注册到【采购订单】“表单构建插件”上。


界面运行时,实际效果 【采购订单】 的 “明细信息” 单据体 实现了首行过滤,
cgddshgl.PNG 
同样 因为注册的动态脚本代码是通过控件类型进行判断的,“交货安排” 页签的单据体类型控件也实现了首行过滤,
cgddshgl1.PNG 

送上Python脚本

#实现单据体首行过滤 
#by wanghl 2015-11-6
clr.AddReference('System')
clr.AddReference('Kingdee.BOS.Core')
from Kingdee.BOS.Core.DynamicForm.PlugIn import *
from Kingdee.BOS.Core.Metadata.EntityElement import *
from System import *

#方法覆写
def CreateControl(e):
        if isinstance(e.ControlAppearance, EntryEntityAppearance):
                e.Control.Put("showFilterRow", True);


原文地址:https://www.cnblogs.com/fyq891014/p/8698056.html