二开案例.python插件.打调用堆栈
【场景】打调用堆栈
【代码】
![image.webp](/download/0100fce2cebb3a244cacaca0c54a24a47d69.webp)
```python
import clr
clr.AddReference("mscorlib")
clr.AddReference("System.Data")
#本次引用
clr.AddReference("Kingdee.BOS.Core")
clr.AddReference("Kingdee.BOS.Log")
from System import *
from System.Collections.Generic import *
from System.Data import *
##本次引用
from Kingdee.BOS.Core.DynamicForm.PlugIn import *
from Kingdee.BOS.Core.DynamicForm.PlugIn.Args import *
from Kingdee.BOS.Log import *
from System.Diagnostics import *
def BeginOperationTransaction(e):
billNoProp = this.BusinessInfo.GetBillNoField().PropertyName;
billInfos = '';
for idx in range(len(e.DataEntitys)):
dataEntity = e.DataEntitys[idx];
pk = dataEntity[0];
billNo = dataEntity[billNoProp];
billInfos += str(pk) +'('+ str(billNo) +'),';
logMsgList = List[str]();
logMsgList.Add(billInfos);
stackFrames = StackTrace().GetFrames();
for idx in range(len(stackFrames)):
curStack = stackFrames[idx];
method = curStack.GetMethod();
fullName = '' if method.DeclaringType == None else method.DeclaringType.FullName;
msg = str(method.Module)+'=> ' + (fullName) +' , ' +str(method);
logMsgList.Add(msg);
totalMsg = '\r\n'.join(logMsgList);
Logger.Error("SHOW STACKTRACE", totalMsg, None);
```
【效果】
![image.webp](/download/0100fda32ec334e043a8af11738499414db9.webp)
二开案例.python插件.打调用堆栈
【场景】打调用堆栈【代码】![image.webp](/download/0100fce2cebb3a244cacaca0c54a24a47d69.webp)```pythonimport clrclr.AddReference("...
点击下载文档
上一篇:销售未开票业务数据下一篇:委外和生产管理账务处理(启用产品成本核算)
本文2024-09-16 18:11:50发表“云星空知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-k3cloud-20578.html
您需要登录后才可以发表评论, 登录登录 或者 注册
最新文档
热门文章