the document Header Setup code is as follows:
Clr. AddReference (' System ')
Clr. AddReference (' Kingdee.BOS.Core ')
fromKingdee.BOS.Core.DynamicForm.PlugInImport*
fromKingdee.BOS.Core.Metadata.EntityElementImport*
fromSystemImport*
defCreateControl (E):
ifE.controlappearance.key = ="FAmount1":#控件标识
#设定控件背景颜色
e.control["BackColor"] =' #FF7F00 ';
#设定控件字体颜色
e.control["ForeColor"] =' #FF0000 ';
The document body Setup code is as follows:
#PythonEntitySetColor
#如下Python脚本 the "Sales order" "Details" document is clicked on the document Body menu,
# details document body first row background color set to XXX, field ' item name ' foreground color set to red
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
Python Set document header color