对单据头设置代码如下:
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 e.ControlAppearance.Key == "FAmount1":#控件标识 #设定控件背景颜色 e.Control["backcolor"] = '#FF7F00'; #设定控件字体颜色 e.Control["forecolor"] = '#FF0000';对单据体设置代码如下:
#PythonEntitySetColor
#如下Python脚本 实现【销售订单】“明细信息”单据体点击单据体菜单时,
#“明细信息”单据体首行背景色设置为×××,字段“物料名称”前景色设置为红色
clr.AddReference('Kingdee.BOS.Core')
from Kingdee.BOS.Core.DynamicForm.PlugIn.ControlModel import *
def AfterEntryBarItemClick(e):
grid = this.View.GetControl[EntryGrid]("FSaleOrderEntry")#需要设置的单据体标识Key
grid.SetRowBackcolor("#FFFF00", 0)#设置整行背景颜色
grid.SetForecolor("FMaterialName","#FF0000", 0)#需要设置字段标识Key