电脑桌面
添加蚂蚁七词文库到电脑桌面
安装后可以在桌面快捷访问

保存时自动生成批号——python脚本

来源:金蝶云社区作者:金蝶2024-09-233

保存时自动生成批号——python脚本

原理参考:【[单据保存时如何自动生成批号](https://vip.kingdee.com/article/329936268761261824?productLineId=1)】 ### python实现(以采购订单为例) > 由于是直接在保存操作插件中调用的自动获取,支持导入时自动获取 ```python import clr clr.AddReference('Kingdee.BOS') clr.AddReference('Kingdee.BOS.Core') clr.AddReference('Kingdee.BOS.App') clr.AddReference('Kingdee.K3.SCM.Contracts') clr.AddReference('Kingdee.K3.Core') clr.AddReference('Kingdee.BOS.DataEntity') from Kingdee.BOS import * from Kingdee.BOS.Core import * from Kingdee.BOS.Core.DynamicForm.PlugIn import * from Kingdee.BOS.Core.Metadata.FieldElement import * from Kingdee.BOS.Core.Base import * from Kingdee.K3.SCM.Contracts import * from Kingdee.K3.Core.SCM.STK import * from Kingdee.BOS.Orm.DataEntity import * def OnPreparePropertys(e): e.FieldKeys.Add("FLot") def BeforeDoSaveExecute(e): lotField = this.BusinessInfo.GetField("FLot") if lotField == None or lotField.OrgFieldKey == "" or lotField.ControlFieldKey == "" or lotField.InputModel != lotField.Enum_InputModel.TextAndSelect: return exEntitySet = ExtendedDataEntitySet() exEntitySet.Parse(e.DataEntities, this.BusinessInfo) entitys = exEntitySet.FindByEntityKey(lotField.EntityKey) lotService = ServiceFactory.GetLotService(this.Context) codeRet = lotService.GenerateLotMasterByCodeRule(this.Co

保存时自动生成批号——python脚本

原理参考:【[单据保存时如何自动生成批号](https://vip.kingdee.com/article/329936268761261824?productLineId=1)】### python实现(以采...
点击下载文档文档为doc格式

声明:除非特别标注,否则均为本站原创文章,转载时请以链接形式注明文章出处。如若本站内容侵犯了原著者的合法权益,可联系本站删除。

已经是第一篇
确认删除?
回到顶部
客服QQ
  • 客服QQ点击这里给我发消息
QQ群
  • 答案:my7c点击这里加入QQ群
支持邮箱
微信
  • 微信