采购订单复制时自动携带用户绑定的采购员
### 注册表单插件
在采购订单中注册一个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://wenku.my7c.com/link/s/lbRPP](https://wenku.my7c.com/link/s/lbRPP)
采购订单复制时自动携带用户绑定的采购员
### 注册表单插件在采购订单中注册一个python脚本的表单插件![QQ截图20230412162813.webp](/download/01001d57dbb1384c4e5491832759d9b35e...
点击下载文档
上一篇:前台显示单据分录内码下一篇:单据保存时自动设置辅助属性的值
本文2024-09-16 19:01:51发表“云星空知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-k3cloud-25959.html
您需要登录后才可以发表评论, 登录登录 或者 注册
最新文档
热门文章