表单插件--撤销按钮被点击后删除下游单据
# 开发时间:2024/7/29 15:34 ##****************************表单插件--撤销按钮被点击后删除下游单据******************* #引入clr运行库 import clr clr.AddReference('System') clr.AddReference('System.Data') clr.AddReference('Kingdee.BOS.App') clr.AddReference('Kingdee.BOS') clr.AddReference('Kingdee.BOS.Core') clr.AddReference('Kingdee.BOS.WebApi.FormService') clr.AddReference('Kingdee.BOS.ServiceFacade.KDServiceFx') clr.AddReference('Newtonsoft.Json') from Kingdee.BOS.App.Data import * from Kingdee.BOS import * from Kingdee.BOS.Core.DynamicForm import * from Kingdee.BOS.Core.DynamicService import * from System import * from System.Data import * from System.Collections.Generic import * from Kingdee.BOS.WebApi.FormService import * from Kingdee.BOS.ServiceFacade.KDServiceFx import * from Newtonsoft.Json.Linq import * def BarItemClick(e): if e.BarItemKey=="tbCancelAssign":#自定义按钮的标识 Billid = this.View.Model.DataObject["Id"].ToString(); sql=("""/*dialect*/SELECT t2.FID FROM T_PRD_ISSUEMTRNOTICE t1 LEFT JOIN ( SELECT distinct FSourceBillId, fid = ( stuff( ( SELECT ',' + CAST ( FID AS VARCHAR ( 20 ) ) FROM PZEJ_PRD_ISSNOTICE WHERE FSourceBillId = a.FSourceBillId FOR xml path ( '' ) ), 1, 1, '' ) ) FROM PZEJ_PRD_ISSNOTICE a ) t2 on t1.Fid=t2.FSourceBillId WHERE t1.Fid = {0}""").format(Billid);#SQL语句,获取下游单据的FID,自行替换即可 BillIdstr = str(DBUtils.ExecuteScalar(this.Context, sql, None)) apiResult = DeleteBill(BillIdstr) def DeleteBill(BillIdstr): jsonData = """{"Ids":"BIllIds"}""" json = jsonData.Replace("BIllIds", BillIdstr) apiResult = WebApiServiceCall.Delete(this.Context, "PZEJ_PRD_ISSUEMTRNOTICE", json)#WebApiServiceCall调用接口具体的操作标识 return apiResult
最近写的一个python,分享出来,希望能给其他小伙伴提供到思路,也希望有大神能提出优化改进的地方。
表单插件--撤销按钮被点击后删除下游单据
# 开发时间:2024/7/29 15:34##****************************表单插件--撤销按钮被点击后删除下游单据*******************#引入clr运行库im...
点击下载文档
本文2024-09-16 18:05:34发表“云星空知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-k3cloud-19892.html
您需要登录后才可以发表评论, 登录登录 或者 注册
最新文档
热门文章