DEP脚本报错,不知道什么原因

栏目:eas cloud知识作者:金蝶来源:金蝶云社区发布:2024-09-16浏览:1

DEP脚本报错,不知道什么原因

var materialBiz = pluginCtx.getKDTable("kdtEntry").getColumn("materialNum").getEditor().getComponent();
var materialChangeEvent = function(event,methodName){
if(methodName == "equals"){ return this == event;}
if(methodName == "editStopping"){
var kdtEntrys = pluginCtx.getKDTable("kdtEntry");
var rowIndex = kdtEntrys.getSelectManager().getActiveRowIndex();
var colIndex = kdtEntrys.getSelectManager().getActiveColumnIndex();
//如果是物料改变,则携带包装规格
if (kdtEntrys.getColumn("materialNum").getColumnIndex() == colIndex) {
var material = kdtEntrys.getCell(rowIndex,colIndex).getValue();
if (material != null){
kdtEntrys.getCell(rowIndex,"wlbzgg").setValue(material.getObjectValue("bzflag"));
}else{
kdtEntrys.getCell(rowIndex,"").setValue(null);
}
}
}
};
pluginCtx.getKDTable("kdtEntry").addKDTEditListener(materialChangeEvent);

错误提示:getColumn为空


处理了,是因为pluginCtx.getKDTable("kdtEntry"),中的kdtEntry,你需要根据不同单据去改变

错误信息:Plugin script execute error, please check whether script is right.
方案Inpurbzgg中的脚本存在问题。脚本如下:
var materialBiz = pluginCtx.getKDTable("kdtEntry").getColumn("materialNum").getEditor().getComponent();
var materialChangeEvent = function(event,methodName){
if(methodName == "equals"){ return this == event;}
if(methodName == "editStopping"){
var kdtEntrys = pluginCtx.getKDTable("kdtEntry");
var rowIndex = kdtEntrys.getSelectManager().getActiveRowIndex();
var colIndex = kdtEntrys.getSelectManager().getActiveColumnIndex();

//如果是物料改变,则携带包装规格
if (kdtEntrys.getColumn("materialNum").getColumnIndex() == colIndex) {
var material = kdtEntrys.getCell(rowIndex,colIndex).getValue();
if (material != null){
kdtEntrys.getCell(rowIndex,"wlbzgg").setValue(material.getObjectValue("bzflag"));
}else{
kdtEntrys.getCell(rowIndex,"").setValue(null);
}
}
}
};
pluginCtx.getKDTable("kdtEntry").addKDTEditListener(materialChangeEvent);

Caused exception message is: TypeError: Cannot call method "getColumn" of null
错误详细堆栈信息:com.kingdee.eas.ep.plugin.ScriptExecuteException: Plugin script execute error, please check whether script is right.


不发错误日志看不出来原因的

DEP脚本报错,不知道什么原因

var materialBiz = pluginCtx.getKDTable("kdtEntry").getColumn("materialNum").getEditor().getComponent();var materialChangeEvent...
点击下载文档
确认删除?
回到顶部
客服QQ
  • 客服QQ点击这里给我发消息