采购订单下推采购收货单时,报DEP脚本错误。但是这个DEP又是系统自带的,不允许禁用。采购收货单手工新增也报相同的错误。
如图。
报错日志:
错误信息:Plugin script execute error, please check whether script is right.
方案DeviceSolution中的脚本存在问题。脚本如下:
//采购收货单onload之后 累计设备档案数量的精度变化
var easNames = JavaImporter();
easNames.importPackage(Packages.com.kingdee.bos.ctrl.extendcontrols);
easNames.importPackage(Packages.com.kingdee.bos);
easNames.importPackage(Packages.com.kingdee.bos.util);
easNames.importPackage(Packages.com.kingdee.bos.metadata);
easNames.importPackage(Packages.com.kingdee.eas.util.client);
easNames.importPackage(Packages.com.kingdee.bos.framework);
easNames.importPackage(Packages.com.kingdee.eas.eqm.archives);
easNames.importPackage(Packages.com.kingdee.eas.basedata.scm.common);
easNames.importPackage(Packages.com.kingdee.bos.ctrl.kdf.table);
with(easNames){
var oprStatus = pluginCtx.getOprtState();
var kdtable = pluginCtx.getKDTable("kdtEntry");
var sum = kdtable.getRowCount();
for(var i=0;i
var accuEquipmentArchiveQty = row.getCell("accuEquipmentArchiveQty");
var qtyFields = new Array("accuEquipmentArchiveQty");
// 设置精度
com.kingdee.eas.scm.common.client.SCMClientUtils.changeCellPrecision(row,qtyFields, 0);
}
//修改菜单,按钮图标和快捷键
var btnEQM=pluginCtx.getKDWorkButton("btnGeneEqm2");
var menuEQM=pluginCtx.getKDMenuItem("menuItemGeneEqm2");
var geneLocal = com.kingdee.eas.common.client.SysContext.getSysContext().getLocale();
var icon = com.kingdee.eas.util.EASCommonResource.getIcon("com.kingdee.eas.basedata.common.EASImageResource","imgTbtn_seeicdeviceaccessory",geneLocal);
menuEQM.setIcon(icon);
btnEQM.setIcon(icon);
menuEQM.setMnemonic(69);
menuEQM.setText("生成设备档案(E)");
}
Caused exception message is: TypeError: Cannot call method "setIcon" of null (unnamed script#28)
错误详细堆栈信息:com.kingdee.eas.ep.plugin.ScriptExecuteException: Plugin script execute error, please check whether script is right.
方案DeviceSolution中的脚本存在问题。脚本如下:
//采购收货单onload之后 累计设备档案数量的精度变化
var easNames = JavaImporter();
easNames.importPackage(Packages.com.kingdee.bos.ctrl.extendcontrols);
easNames.importPackage(Packages.com.kingdee.bos);
easNames.importPackage(Packages.com.kingdee.bos.util);
easNames.importPackage(Packages.com.kingdee.bos.metadata);
easNames.importPackage(Packages.com.kingdee.eas.util.client);
easNames.importPackage(Packages.com.kingdee.bos.framework);
easNames.importPackage(Packages.com.kingdee.eas.eqm.archives);
easNames.importPackage(Packages.com.kingdee.eas.basedata.scm.common);
easNames.importPackage(Packages.com.kingdee.bos.ctrl.kdf.table);
with(easNames){
var oprStatus = pluginCtx.getOprtState();
var kdtable = pluginCtx.getKDTable("kdtEntry");
var sum = kdtable.getRowCount();
for(var i=0;i
var accuEquipmentArchiveQty = row.getCell("accuEquipmentArchiveQty");
var qtyFields = new Array("accuEquipmentArchiveQty");
// 设置精度
com.kingdee.eas.scm.common.client.SCMClientUtils.changeCellPrecision(row,qtyFields, 0);
}
//修改菜单,按钮图标和快捷键
var btnEQM=pluginCtx.getKDWorkButton("btnGeneEqm2");
var menuEQM=pluginCtx.getKDMenuItem("menuItemGeneEqm2");
var geneLocal = com.kingdee.eas.common.client.SysContext.getSysContext().getLocale();
var icon = com.kingdee.eas.util.EASCommonResource.getIcon("com.kingdee.eas.basedata.common.EASImageResource","imgTbtn_seeicdeviceaccessory",geneLocal);
menuEQM.setIcon(icon);
btnEQM.setIcon(icon);
menuEQM.setMnemonic(69);
menuEQM.setText("生成设备档案(E)");
}
Caused exception message is: TypeError: Cannot call method "setIcon" of null (unnamed script#28)
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:114)
at com.kingdee.eas.ep.client.ExtendMethodInterceptor.intercept(ExtendMethodInterceptor.java:104)
at com.kingdee.eas.scm.im.inv.client.PurReceivalBillEditUI$$EnhancerByCGLIB$$dea21ec4.onLoad(
at com.kingdee.eas.base.uiframe.client.UIFactoryHelper.initUIObject(UIFactoryHelper.java:296)
at com.kingdee.eas.base.uiframe.client.UINewFrameFactory.create(UINewFrameFactory.java:105)
at com.kingdee.eas.base.uiframe.client.UINewFrameFactory.create(UINewFrameFactory.java:44)
at com.kingdee.eas.base.btp.client.BTPBillEditImpl.CreateTo(BTPBillEditImpl.java:803)
at com.kingdee.eas.scm.common.client.SCMBillEditUI.createToBill(SCMBillEditUI.java:5756)
at com.kingdee.eas.scm.common.client.SCMBillEditUI$ActionBizProcess.actionPerformed(SCMBillEditUI.java:5816)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.AbstractButton.doClick(AbstractButton.java:357)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:809)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:850)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
at java.awt.Component.processMouseEvent(Component.java:6288)
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:4238)
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 "setIcon" of null (unnamed script#28)
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_10._c_script_0(unnamed script:28)
at org.mozilla.javascript.gen.unnamed_script_10.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_10.call(unnamed script)
at org.mozilla.javascript.gen.unnamed_script_10.exec(unnamed script)
at org.mozilla.javascript.Context.evaluateString(Context.java:1111)
at com.kingdee.eas.ep.client.ScriptExecutor.execute(ScriptExecutor.java:50)
... 54 more
Caused by: org.mozilla.javascript.EcmaError
org.mozilla.javascript.EcmaError: TypeError: Cannot call method "setIcon" of null (unnamed script#28)
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_10._c_script_0(unnamed script:28)
at org.mozilla.javascript.gen.unnamed_script_10.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_10.call(unnamed script)
at org.mozilla.javascript.gen.unnamed_script_10.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:114)
at com.kingdee.eas.ep.client.ExtendMethodInterceptor.intercept(ExtendMethodInterceptor.java:104)
at com.kingdee.eas.scm.im.inv.client.PurReceivalBillEditUI$$EnhancerByCGLIB$$dea21ec4.onLoad(
at com.kingdee.eas.base.uiframe.client.UIFactoryHelper.initUIObject(UIFactoryHelper.java:296)
at com.kingdee.eas.base.uiframe.client.UINewFrameFactory.create(UINewFrameFactory.java:105)
at com.kingdee.eas.base.uiframe.client.UINewFrameFactory.create(UINewFrameFactory.java:44)
at com.kingdee.eas.base.btp.client.BTPBillEditImpl.CreateTo(BTPBillEditImpl.java:803)
at com.kingdee.eas.scm.common.client.SCMBillEditUI.createToBill(SCMBillEditUI.java:5756)
at com.kingdee.eas.scm.common.client.SCMBillEditUI$ActionBizProcess.actionPerformed(SCMBillEditUI.java:5816)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.AbstractButton.doClick(AbstractButton.java:357)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:809)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:850)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
at java.awt.Component.processMouseEvent(Component.java:6288)
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:4238)
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)
推荐阅读