#引入clr运行库
import clr
#添加对cloud插件开发的常用组件的引用
clr.AddReference('Kingdee.BOS')
clr.AddReference('Kingdee.BOS.Core')
clr.AddReference('Kingdee.BOS.App')
clr.AddReference("System")
clr.AddReference("System.Linq")
clr.AddReference("System.ComponentModel")
clr.AddReference("System.Core")
#clr.AddReference("Kingdee.BOS")
clr.AddReference("Kingdee.BOS.ServiceHelper")
clr.AddReference("Kingdee.BOS.DataEntity")
clr.AddReference('mscorlib')
#clr.AddReference('Kingdee.BOS.Core.DynamicForm.PlugIn')
#clr.AddReference('Kingdee.BOS.Core.DynamicForm.PlugIn.Args')
from Kingdee.BOS.Core.Bill.PlugIn import *
from Kingdee.BOS.Core.DynamicForm.PlugIn.Args import *
from Kingdee.BOS.JSON import *
from Kingdee.BOS.Util import *
from System import *
from Kingdee.BOS.Core.Bill import *
from Kingdee.BOS.Core.DynamicForm import *
from Kingdee.BOS.DataEntity import *
from Kingdee.BOS.Orm.DataEntity import *
from Kingdee.BOS.App.Data import *
from Kingdee.BOS.ServiceHelper import *
#from Kingdee.K3.SCM.App.Core.WebApi import *
from Kingdee.BOS.Core.Metadata import SelectorItemInfo ##字段选择实体类
from Kingdee.BOS.Core.SqlBuilder import QueryBuilderParemeter ##查询参数实体类
#文本超链接执行方法
def EntryButtonCellClick(e):
#单据编号标识
if e.FieldKey.Equals("F_PAEZ_Text", StringComparison.OrdinalIgnoreCase):
#获取传递过来的参数,本单据中为收款单的单据编号
fbillno=this.Model.GetValue(e.FieldKey,e.Row);
queryParam = QueryBuilderParemeter();
queryParam.FormId = "AR_RECEIVEBILL";
queryParam.SelectItems.Add(SelectorItemInfo("FID"));
queryParam.FilterClauseWihtKey ="FBillNo ='%s'" %fbillno #. format("","SKD00000753" #, "SKD00000753");
# using Kingdee.BOS.ServiceHelper;
objs = QueryServiceHelper.GetDynamicObjectCollection(this.Context, queryParam);
result=objs[0][0]
parameter =BillShowParameter();
parameter.Status = OperationStatus.EDIT;
parameter.FormId = "AR_RECEIVEBILL";#收款单
parameter.PKey = str(result);
parameter.OpenStyle.ShowType =ShowType.MainNewTabPage;#打开方式,到主界面一个新的页签
#param.ParentPageId = this.View.PageId;//指定ParentPageId,可以实现打开的界面直接拿到父界面的数据 如this.View.ParentFormView.Model.DataObject
this.View.ShowForm(parameter);