DEP脚本的错误提示,大神帮我看看吧

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

DEP脚本的错误提示,大神帮我看看吧

错误信息:Plugin script execute error, please check whether script is right.
方案Inpurbzgg中的脚本存在问题。脚本如下:
pluginCtx.getKDTable("kdtEntry").addKDTEditListener(materialChangeEvent);
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);
}
}
}
};

Caused exception message is: TypeError: Cannot call method "addKDTEditListener" of null
错误详细堆栈信息:com.kingdee.eas.ep.plugin.ScriptExecuteException: Plugin script execute error, please check whether script is right.
方案Inpurbzgg中的脚本存在问题。脚本如下:
pluginCtx.getKDTable("kdtEntry").addKDTEditListener(materialChangeEvent);
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);
}
}
}
};

Caused exception message is: TypeError: Cannot call method "addKDTEditListener" of null
at com.kingdee.eas.ep.plugin.PluginUtils.getScriptExecuteException(PluginUtils.java:104)
at com.kingdee.eas.ep.plugin.PluginUtils.handleScriptException(PluginUtils.java:69)
at com.kingdee.eas.ep.client.ScriptExecutor.execute(ScriptExecutor.java:52)
at com.kingdee.eas.ep.client.ExtendMethodInterceptor.executeScript(ExtendMethodInterceptor.java:135)
at com.kingdee.eas.ep.client.ExtendMethodInterceptor.intercept(ExtendMethodInterceptor.java:108)
at com.kingdee.eas.scm.im.inv.client.PurInWarehsBillEditUI$$EnhancerByCGLIB$$bb7bb053.onLoad()
at com.kingdee.eas.base.uiframe.client.UIFactoryHelper.initUIObject(UIFactoryHelper.java:296)
at com.kingdee.eas.base.uiframe.client.UINewTabFactory.create(UINewTabFactory.java:110)
at com.kingdee.eas.base.uiframe.client.UIShowHelper.innerCreateUI(UIShowHelper.java:119)
at com.kingdee.eas.base.uiframe.client.UIShowHelper.passCreateUI(UIShowHelper.java:91)
at com.kingdee.eas.base.uiframe.client.UIShowHelper.createUI(UIShowHelper.java:71)
at com.kingdee.eas.base.uiframe.client.UIShowHelper.showUI(UIShowHelper.java:46)
at com.kingdee.eas.base.uiframe.client.UIShowHelper.showUI(UIShowHelper.java:24)
at com.kingdee.eas.base.uiframe.client.LeafMenuCellPane.performDblclick(LeafMenuCellPane.java:220)
at com.kingdee.eas.base.uiframe.client.LeafMenuCellPane.access$500(LeafMenuCellPane.java:37)
at com.kingdee.eas.base.uiframe.client.LeafMenuCellPane$TopLabelMouseAdapter.mouseClicked(LeafMenuCellPane.java:89)
at java.awt.Component.processMouseEvent(Component.java:6291)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
at java.awt.Component.processEvent(Component.java:6053)
at java.awt.Container.processEvent(Container.java:2041)
at java.awt.Component.dispatchEventImpl(Component.java:4651)
at java.awt.Container.dispatchEventImpl(Container.java:2099)
at java.awt.Component.dispatchEvent(Component.java:4481)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4247)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
at java.awt.Container.dispatchEventImpl(Container.java:2085)
at java.awt.Window.dispatchEventImpl(Window.java:2478)
at java.awt.Component.dispatchEvent(Component.java:4481)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:643)
at java.awt.EventQueue.access$000(EventQueue.java:84)
at java.awt.EventQueue$1.run(EventQueue.java:602)
at java.awt.EventQueue$1.run(EventQueue.java:600)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
at java.awt.EventQueue$2.run(EventQueue.java:616)
at java.awt.EventQueue$2.run(EventQueue.java:614)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:613)
at com.kingdee.bos.invokecounter.RPCLogEventQueue.dispatchEvent(RPCLogEventQueue.java:176)
at sun.reflect.GeneratedMethodAccessor12.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.kingdee.eas.client.recorder.UserInputEventQueue.myDispatchEvent(UserInputEventQueue.java:126)
at com.kingdee.eas.client.recorder.UserInputEventQueue.dispatchEvent(UserInputEventQueue.java:59)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Caused by: org.mozilla.javascript.EcmaError: TypeError: Cannot call method "addKDTEditListener" of null
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3753)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3731)
at org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3759)
at org.mozilla.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3778)
at org.mozilla.javascript.ScriptRuntime.undefCallError(ScriptRuntime.java:3797)
at org.mozilla.javascript.ScriptRuntime.getPropFunctionAndThisHelper(ScriptRuntime.java:2317)
at org.mozilla.javascript.ScriptRuntime.getPropFunctionAndThis(ScriptRuntime.java:2310)
at org.mozilla.javascript.gen.unnamed_script_1._c_script_0(unnamed script:0)
at org.mozilla.javascript.gen.unnamed_script_1.call(unnamed script)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:426)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3157)
at org.mozilla.javascript.gen.unnamed_script_1.call(unnamed script)
at org.mozilla.javascript.gen.unnamed_script_1.exec(unnamed script)
at org.mozilla.javascript.Context.evaluateString(Context.java:1111)
at com.kingdee.eas.ep.client.ScriptExecutor.execute(ScriptExecutor.java:50)
... 50 more
Caused by: org.mozilla.javascript.EcmaError
org.mozilla.javascript.EcmaError: TypeError: Cannot call method "addKDTEditListener" of null
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3753)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3731)
at org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3759)
at org.mozilla.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3778)
at org.mozilla.javascript.ScriptRuntime.undefCallError(ScriptRuntime.java:3797)
at org.mozilla.javascript.ScriptRuntime.getPropFunctionAndThisHelper(ScriptRuntime.java:2317)
at org.mozilla.javascript.ScriptRuntime.getPropFunctionAndThis(ScriptRuntime.java:2310)
at org.mozilla.javascript.gen.unnamed_script_1._c_script_0(unnamed script:0)
at org.mozilla.javascript.gen.unnamed_script_1.call(unnamed script)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:426)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3157)
at org.mozilla.javascript.gen.unnamed_script_1.call(unnamed script)
at org.mozilla.javascript.gen.unnamed_script_1.exec(unnamed script)
at org.mozilla.javascript.Context.evaluateString(Context.java:1111)
at com.kingdee.eas.ep.client.ScriptExecutor.execute(ScriptExecutor.java:50)
at com.kingdee.eas.ep.client.ExtendMethodInterceptor.executeScript(ExtendMethodInterceptor.java:135)
at com.kingdee.eas.ep.client.ExtendMethodInterceptor.intercept(ExtendMethodInterceptor.java:108)
at com.kingdee.eas.scm.im.inv.client.PurInWarehsBillEditUI$$EnhancerByCGLIB$$bb7bb053.onLoad()
at com.kingdee.eas.base.uiframe.client.UIFactoryHelper.initUIObject(UIFactoryHelper.java:296)
at com.kingdee.eas.base.uiframe.client.UINewTabFactory.create(UINewTabFactory.java:110)
at com.kingdee.eas.base.uiframe.client.UIShowHelper.innerCreateUI(UIShowHelper.java:119)
at com.kingdee.eas.base.uiframe.client.UIShowHelper.passCreateUI(UIShowHelper.java:91)
at com.kingdee.eas.base.uiframe.client.UIShowHelper.createUI(UIShowHelper.java:71)
at com.kingdee.eas.base.uiframe.client.UIShowHelper.showUI(UIShowHelper.java:46)
at com.kingdee.eas.base.uiframe.client.UIShowHelper.showUI(UIShowHelper.java:24)
at com.kingdee.eas.base.uiframe.client.LeafMenuCellPane.performDblclick(LeafMenuCellPane.java:220)
at com.kingdee.eas.base.uiframe.client.LeafMenuCellPane.access$500(LeafMenuCellPane.java:37)
at com.kingdee.eas.base.uiframe.client.LeafMenuCellPane$TopLabelMouseAdapter.mouseClicked(LeafMenuCellPane.java:89)
at java.awt.Component.processMouseEvent(Component.java:6291)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
at java.awt.Component.processEvent(Component.java:6053)
at java.awt.Container.processEvent(Container.java:2041)
at java.awt.Component.dispatchEventImpl(Component.java:4651)
at java.awt.Container.dispatchEventImpl(Container.java:2099)
at java.awt.Component.dispatchEvent(Component.java:4481)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4247)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
at java.awt.Container.dispatchEventImpl(Container.java:2085)
at java.awt.Window.dispatchEventImpl(Window.java:2478)
at java.awt.Component.dispatchEvent(Component.java:4481)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:643)
at java.awt.EventQueue.access$000(EventQueue.java:84)
at java.awt.EventQueue$1.run(EventQueue.java:602)
at java.awt.EventQueue$1.run(EventQueue.java:600)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
at java.awt.EventQueue$2.run(EventQueue.java:616)
at java.awt.EventQueue$2.run(EventQueue.java:614)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:613)
at com.kingdee.bos.invokecounter.RPCLogEventQueue.dispatchEvent(RPCLogEventQueue.java:176)
at sun.reflect.GeneratedMethodAccessor12.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.kingdee.eas.client.recorder.UserInputEventQueue.myDispatchEvent(UserInputEventQueue.java:126)
at com.kingdee.eas.client.recorder.UserInputEventQueue.dispatchEvent(UserInputEventQueue.java:59)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)


pluginCtx.getKDTable("kdtEntry")这个拿不到。是不是参数写错了?
要先定义了materialChangeEvent事件才能添加吧,你把定义事件放前面
pluginCtx.getKDTable("detailTable").addKDTEditListener(materialChangeEvent);
我进行调试执行的时候,这个语句就报错了。是否我还需要增加其他的监听啊

pluginCtx.getKDTable("kdtEntry")

看下是不是 kdtEntry 填错了

DEP脚本的错误提示,大神帮我看看吧

错误信息:Plugin script execute error, please check whether script is right.方案Inpurbzgg中的脚本存在问题。脚本如下:plug...
点击下载文档
确认删除?
回到顶部
客服QQ
  • 客服QQ点击这里给我发消息