采购订单复制时自动携带用户绑定的采购员

栏目:云星空知识作者:金蝶来源:金蝶云社区发布:2024-09-23浏览:1

采购订单复制时自动携带用户绑定的采购员

### 注册表单插件 在采购订单中注册一个python脚本的表单插件 ![QQ截图20230412162813.webp](/download/01001d57dbb1384c4e5491832759d9b35e7c.webp) ### python脚本示例 ```python import clr clr.AddReference('mscorlib') clr.AddReference('System') clr.AddReference('System.Data') clr.AddReference('Kingdee.BOS.App') clr.AddReference('Kingdee.BOS.ServiceHelper') from System import * from System.Data import * from Kingdee.BOS.App.Data import * from Kingdee.BOS.ServiceHelper import * def AfterCreateNewData(e): this.View.Model.SetValue("FPurchaserId",GetBuyerByUser(),0) def GetBuyerByUser(): orgId = this.Context.CurrentOrganizationInfo.ID userId = this.Context.UserId sql = """SELECT t0.FENTRYID FROM T_BD_OPERATORENTRY t0 INNER JOIN T_BD_STAFF t1 on t0.FSTAFFID=t1.FSTAFFID INNER JOIN T_SEC_USER t3 on t1.FPERSONID = t3.FLINKOBJECT WHERE t3.FUSERID = {0} and t0.FOPERATORTYPE = 'CGY' and t0.FBIZORGID={1} and t0.FISUSE='1'""".format(str(userId),str(orgId)) purchaserId = DBUtils.ExecuteScalar(this.Context, sql, None) if purchaserId != None: return purchaserId else: return 0 ``` **其他更多文章入口:**[https://vip.kingdee.com/link/s/lbRPP](https://vip.kingdee.com/link/s/lbRPP)

采购订单复制时自动携带用户绑定的采购员

### 注册表单插件在采购订单中注册一个python脚本的表单插件![QQ截图20230412162813.webp](/download/01001d57dbb1384c4e5491832759d9b35e...
点击下载文档
确认删除?
回到顶部
客服QQ
  • 客服QQ点击这里给我发消息