错误信息:Plugin script execute error, please check whether script is right.
方案Supplier中的脚本存在问题。脚本如下:
var imp = JavaImporter();
imp.importPackage(Packages.com.kingdee.eas.scm.im.inv.client);
imp.importPackage(Packages.com.kingdee.bos.ctrl.kdf.table);
imp.importPackage(Packages.com.kingdee.bos.ctrl.kdf.table.event);
imp.importPackage(Packages.com.kingdee.bos.ctrl.kdf.util.editor);
imp.importPackage(Packages.com.kingdee.bos.ctrl.swing);
imp.importPackage(Packages.com.kingdee.bos.ctrl.swing.event);
imp.importPackage(Packages.com.kingdee.bos);
imp.importPackage(Packages.com.kingdee.bos.util);
imp.importPackage(Packages.com.kingdee.bos.metadata);
imp.importPackage(Packages.com.kingdee.bos.framework);
imp.importPackage(Packages.com.kingdee.bos.ctrl.extendcontrols);
imp.importPackage(Packages.com.kingdee.eas.util.client);
imp.importPackage(Packages.java.math);
imp.importPackage(Packages.java.util);
imp.importPackage(Packages.java.awt.event);
imp.importPackage(Packages.javax.swing.event);
imp.importPackage(Packages.com.kingdee.bos.metadata.entity);
imp.importPackage(Packages.com.kingdee.eas.basedata.master.material);
imp.importPackage(Packages.com.kingdee.eas.basedata.app);
imp.importPackage(Packages.com.kingdee.eas.basedata.client);
imp.importPackage(Packages.com.kingdee.eas.basedata);
imp.importPackage(Packages.com.kingdee.bos.metadata.query.util);
with(imp){
var table = pluginCtx.getKDTable("detailTable");
table.addKDTEditListener(KDTEditListener(this));
var view = new EntityViewInfo();
var filter = new FilterInfo();
var aterialornamemInfo=new MaterialornameInfo();
var coll = MaterialornameFactory.getRemoteInstance().getMaterialornameCollection(view);
MsgBox.showInfo("000000000000000");
function editStopped(e){
var row = table.getRow(table.getSelectManager().getActiveRowIndex());
var materialNum = row.getCell("materialNum").getValue();
//MsgBox.showInfo(materialNum.get("id"));
//var coll = MaterialFactory.getRemoteInstance().getMaterialCollection(view);
MsgBox.showInfo("000000000000000");
if(coll.size()>0){
MsgBox.showError("11111111");
}else{
MsgBox.showError("22222222");
}
}
};
Caused exception message is: ReferenceError: "MaterialornameInfo" is not defined. (unnamed script#32)
错误详细堆栈信息:com.kingdee.eas.ep.plugin.ScriptExecuteException: Plugin script execute error, please check whether script is right.
方案Supplier中的脚本存在问题。脚本如下:
var imp = JavaImporter();
imp.importPackage(Packages.com.kingdee.eas.scm.im.inv.client);
imp.importPackage(Packages.com.kingdee.bos.ctrl.kdf.table);
imp.importPackage(Packages.com.kingdee.bos.ctrl.kdf.table.event);
imp.importPackage(Packages.com.kingdee.bos.ctrl.kdf.util.editor);
imp.importPackage(Packages.com.kingdee.bos.ctrl.swing);
imp.importPackage(Packages.com.kingdee.bos.ctrl.swing.event);
imp.importPackage(Packages.com.kingdee.bos);
imp.importPackage(Packages.com.kingdee.bos.util);
imp.importPackage(Packages.com.kingdee.bos.metadata);
imp.importPackage(Packages.com.kingdee.bos.framework);
imp.importPackage(Packages.com.kingdee.bos.ctrl.extendcontrols);
imp.importPackage(Packages.com.kingdee.eas.util.client);
imp.importPackage(Packages.java.math);
imp.importPackage(Packages.java.util);
imp.importPackage(Packages.java.awt.event);
imp.importPackage(Packages.javax.swing.event);
imp.importPackage(Packages.com.kingdee.bos.metadata.entity);
imp.importPackage(Packages.com.kingdee.eas.basedata.master.material);
imp.importPackage(Packages.com.kingdee.eas.basedata.app);
imp.importPackage(Packages.com.kingdee.eas.basedata.client);
imp.importPackage(Packages.com.kingdee.eas.basedata);
imp.importPackage(Packages.com.kingdee.bos.metadata.query.util);
with(imp){
var table = pluginCtx.getKDTable("detailTable");
table.addKDTEditListener(KDTEditListener(this));
var view = new EntityViewInfo();
var filter = new FilterInfo();
var aterialornamemInfo=new MaterialornameInfo();
var coll = MaterialornameFactory.getRemoteInstance().getMaterialornameCollection(view);
MsgBox.showInfo("000000000000000");
function editStopped(e){
var row = table.getRow(table.getSelectManager().getActiveRowIndex());
var materialNum = row.getCell("materialNum").getValue();
//MsgBox.showInfo(materialNum.get("id"));
//var coll = MaterialFactory.getRemoteInstance().getMaterialCollection(view);
MsgBox.showInfo("000000000000000");
if(coll.size()>0){
MsgBox.showError("11111111");
}else{
MsgBox.showError("22222222");
}
}
};
Caused exception message is: ReferenceError: "MaterialornameInfo" is not defined. (unnamed script#32)
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:43)
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.SaleIssueBillEditUI$$EnhancerByCGLIB$$5043edf3.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: ReferenceError: "MaterialornameInfo" is not defined. (unnamed script#32)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3753)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3731)
at org.mozilla.javascript.ScriptRuntime.notFoundError(ScriptRuntime.java:3816)
at org.mozilla.javascript.ScriptRuntime.nameOrFunction(ScriptRuntime.java:1826)
at org.mozilla.javascript.ScriptRuntime.name(ScriptRuntime.java:1765)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1781)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:845)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:426)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3157)
at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:175)
at org.mozilla.javascript.Context.evaluateString(Context.java:1111)
at com.kingdee.eas.ep.client.DebugSkeleton$3$1.run(DebugSkeleton.java:85)
at org.mozilla.javascript.Context.call(Context.java:521)
at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:535)
at com.kingdee.eas.ep.debug.Dim.call(Dim.java:192)
at com.kingdee.eas.ep.client.DebugSkeleton$3.run(DebugSkeleton.java:81)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:641)
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.awt.EventQueue.dispatchEvent(EventQueue.java:611)
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.pumpEventsForFilter(EventDispatchThread.java:178)
at java.awt.Dialog$1.run(Dialog.java:1046)
at java.awt.Dialog$3.run(Dialog.java:1098)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Dialog.show(Dialog.java:1096)
at com.kingdee.bos.ctrl.swing.KDDialog.show(KDDialog.java:186)
at com.kingdee.eas.base.uiframe.client.UIModelDialog.show(UIModelDialog.java:120)
at com.kingdee.eas.ep.client.PlugInUI.open(PlugInUI.java:191)
at com.kingdee.eas.ep.client.DebugSkeleton.debug(DebugSkeleton.java:99)
at com.kingdee.eas.ep.client.ScriptExecutor.execute(ScriptExecutor.java:42)
... 50 more
Caused by: org.mozilla.javascript.EcmaError
org.mozilla.javascript.EcmaError: ReferenceError: "MaterialornameInfo" is not defined. (unnamed script#32)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3753)
at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3731)
at org.mozilla.javascript.ScriptRuntime.notFoundError(ScriptRuntime.java:3816)
at org.mozilla.javascript.ScriptRuntime.nameOrFunction(ScriptRuntime.java:1826)
at org.mozilla.javascript.ScriptRuntime.name(ScriptRuntime.java:1765)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1781)
at script(unnamed script:32)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:845)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:426)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3157)
at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:175)
at org.mozilla.javascript.Context.evaluateString(Context.java:1111)
at com.kingdee.eas.ep.client.DebugSkeleton$3$1.run(DebugSkeleton.java:85)
at org.mozilla.javascript.Context.call(Context.java:521)
at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:535)
at com.kingdee.eas.ep.debug.Dim.call(Dim.java:192)
at com.kingdee.eas.ep.client.DebugSkeleton$3.run(DebugSkeleton.java:81)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:641)
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.awt.EventQueue.dispatchEvent(EventQueue.java:611)
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.pumpEventsForFilter(EventDispatchThread.java:178)
at java.awt.Dialog$1.run(Dialog.java:1046)
at java.awt.Dialog$3.run(Dialog.java:1098)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Dialog.show(Dialog.java:1096)
at com.kingdee.bos.ctrl.swing.KDDialog.show(KDDialog.java:186)
at com.kingdee.eas.base.uiframe.client.UIModelDialog.show(UIModelDialog.java:120)
at com.kingdee.eas.ep.client.PlugInUI.open(PlugInUI.java:191)
at com.kingdee.eas.ep.client.DebugSkeleton.debug(DebugSkeleton.java:99)
at com.kingdee.eas.ep.client.ScriptExecutor.execute(ScriptExecutor.java:42)
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.SaleIssueBillEditUI$$EnhancerByCGLIB$$5043edf3.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)
[_D4@0}~PIRX`AF}(MR)~{N.png(10.03KB)
_N5)~7G(%FJ973VKSCFI_2M.png(16.00KB)
推荐阅读