采购订单复制时自动携带用户绑定的采购员
### 注册表单插件
在采购订单中注册一个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...
点击下载文档
上一篇:复制单据重取汇率下一篇:采购价目表取价二开自定义排序
本文2024-09-23 02:34:24发表“云星空知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-k3cloud-153314.html
您需要登录后才可以发表评论, 登录登录 或者 注册
最新文档
热门文章