import clr
clr.AddReference("System")
clr.AddReference("System.Core")
clr.AddReference("Kingdee.BOS")
clr.AddReference("Kingdee.BOS.Core")
clr.AddReference("Kingdee.BOS.DataEntity")
clr.AddReference("Kingdee.BOS.ServiceHelper")
from Kingdee.BOS.Core.Log import *
from Kingdee.BOS.Core import *
from Kingdee.BOS.Core.DynamicForm import *
from Kingdee.BOS.KDThread import *
from Kingdee.BOS.DataEntity import *
from Kingdee.BOS.Orm.DataEntity import *
from Kingdee.BOS.ServiceHelper import *
from Kingdee.BOS.Core.Metadata import SelectorItemInfo ##字段选择实体类
from Kingdee.BOS.Core.SqlBuilder import QueryBuilderParemeter ##查询参数实体类
from Kingdee.BOS.App.Data import *
from Kingdee.BOS.Core.Bill.PlugIn import *
from Kingdee.BOS.Core.Bill.PlugIn.Args import *
from Kingdee.BOS.Core.DynamicForm.PlugIn.Args import *
def DataChanged(e):
if e.Key=="FMaterialId" and e.NewValue<>"":
#Materialid=this.Model.GetValue("FMaterialId",e.Row)
#sql="/*dialect*/select b.FDESCRIPTION from T_BD_MATERIAL a join T_BD_MATERIAL_L b on a.FMATERIALID=b.FMATERIALID where FNumber like '"+Materialid['Number']+"'"
#result = DBServiceHelper.ExecuteDynamicObject(this.Context, sql)
#this.View.ShowMessage(result[0][0]);
#DBUtils.Execute(this.Context,"DELETE FROM TableA");
sql="insert into tableA(id,AA)values(99,99)"
DBUtils.Execute(this.Context, str(sql))
#DBUtils.Execute(this.Context, "/*dialect*/update a set a.AA=b.AA from (select id,AA from TableA)a,(select id,AA from TableB)b where a.id=b.id");
推荐阅读