DEP 里如何控制F7控制有值时,分录提示不能为空
var bx=pluginCtx.getKDBizPromptBox("prmtlnsuCompany");这个拿到的是空的,调试执行应该可以看出来。
错误信息:Plugin script execute error, please check whether script is right.
方案QJ_Development_modify中的脚本存在问题。脚本如下:
var easImporter = JavaImporter();
easImporter.importPackage(Packages.com.kingdee.bos);
easImporter.importPackage(Packages.com.kingdee.eas.util);
easImporter.importPackage(Packages.com.kingdee.eas.util.client);
with(easImporter){
var txtCause = pluginCtx.getKDTextArea("txtHangtagRemark");
var kdts=pluginCtx.getKDTable("kdtlnsuran");
var bx=pluginCtx.getKDBizPromptBox("prmtlnsuCompany");
//控制分录字段为必录项
if(txtCause.getText().equals(""))
{
MsgBox.showInfo("<上牌备注不能为空>");
SysUtil.abort();
}
if(bx.getValue()!=null && kdts.getRowCount()==0)
{
MsgBox.showInfo("<保险分录不能为空>");
SysUtil.abort();
}
}
Caused exception message is: TypeError: Cannot call method "getValue" of null (unnamed script#15)
错误详细堆栈信息:com.kingdee.eas.ep.plugin.ScriptExecuteException: Plugin script execute error, please check whether script is right.
方案QJ_Development_modify中的脚本存在问题。脚本如下:
var easImporter = JavaImporter();
easImporter.importPackage(Packages.com.kingdee.bos);
easImporter.importPackage(Packages.com.kingdee.eas.util);
easImporter.importPackage(Packages.com.kingdee.eas.util.client);
with(easImporter){
var txtCause = pluginCtx.getKDTextArea("txtHangtagRemark");
var kdts=pluginCtx.getKDTable("kdtlnsuran");
var bx=pluginCtx.getKDBizPromptBox("prmtlnsuCompany");
//控制分录字段为必录项
if(txtCause.getText().equals(""))
{
MsgBox.showInfo("<上牌备注不能为空>");
SysUtil.abort();
}
if(bx.getValue()!=null && kdts.getRowCount()==0)
{
MsgBox.showInfo("<保险分录不能为空>");
SysUtil.abort();
}
}
Caused exception message is: TypeError: Cannot call method "getValue" of null (unnamed script#15)
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:114)
at com.kingdee.eas.ep.client.ExtendMethodInterceptor.intercept(ExtendMethodInterceptor.java:104)
at com.kingdee.eas.auto4s.vam.client.AgentServiceEditUI$$EnhancerByCGLIB$$7f65a286.beforeStoreFields(
at com.kingdee.eas.framework.client.EditUI.verify(EditUI.java:810)
at com.kingdee.eas.framework.client.EditUI.doBeforeSave(EditUI.java:768)
at com.kingdee.eas.auto4s.vam.client.AgentServiceEditUI$$EnhancerByCGLIB$$7f65a286.CGLIB$doBeforeSave$0$310(
at com.kingdee.eas.auto4s.vam.client.AgentServiceEditUI$$EnhancerByCGLIB$$7f65a286$$FastClassByCGLIB$$5195439.invoke(
at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:167)
at com.kingdee.eas.ep.client.ExtendMethodInterceptor.intercept(ExtendMethodInterceptor.java:51)
at com.kingdee.eas.auto4s.vam.client.AgentServiceEditUI$$EnhancerByCGLIB$$7f65a286.doBeforeSave(
at com.kingdee.eas.framework.client.EditUI.actionSave_actionPerformed(EditUI.java:725)
at com.kingdee.eas.framework.client.AbstractCoreBillEditUI.actionSave_actionPerformed(AbstractCoreBillEditUI.java:1052)
at com.kingdee.eas.framework.client.CoreBillEditUI.actionSave_actionPerformed(CoreBillEditUI.java:1019)
at com.kingdee.eas.auto4s.vam.client.AbstractAgentServiceEditUI.actionSave_actionPerformed(AbstractAgentServiceEditUI.java:2991)
at com.kingdee.eas.auto4s.vam.client.AgentServiceEditUI.actionSave_actionPerformed(AgentServiceEditUI.java:2484)
at com.kingdee.eas.auto4s.vam.client.AgentServiceEditUI$$EnhancerByCGLIB$$7f65a286.CGLIB$actionSave_actionPerformed$0$13(
at com.kingdee.eas.auto4s.vam.client.AgentServiceEditUI$$EnhancerByCGLIB$$7f65a286$$FastClassByCGLIB$$5195439.invoke(
at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:167)
at com.kingdee.eas.ep.client.ExtendMethodInterceptor.intercept(ExtendMethodInterceptor.java:51)
at com.kingdee.eas.auto4s.vam.client.AgentServiceEditUI$$EnhancerByCGLIB$$7f65a286.actionSave_actionPerformed(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.kingdee.bos.ui.face.ItemAction.reflectPerformAction(ItemAction.java:442)
at com.kingdee.bos.ui.face.ItemAction.innerActionPerformed(ItemAction.java:395)
at com.kingdee.eas.framework.client.AbstractEditUI$ActionSave.actionPerformed(AbstractEditUI.java:1200)
at com.kingdee.bos.appframework.client.servicebinding.ActionProxy.actionPerformedInvoke(ActionProxy.java:174)
at com.kingdee.bos.appframework.client.servicebinding.ActionProxy.actionPerformed(ActionProxy.java:101)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at com.kingdee.bos.ctrl.swing.KDWorkButton.fireActionPerformed(KDWorkButton.java:567)
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.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
at java.awt.Component.processMouseEvent(Component.java:6038)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3260)
at com.kingdee.bos.ctrl.swing.KDWorkButton.processMouseEvent(KDWorkButton.java:861)
at java.awt.Component.processEvent(Component.java:5803)
at java.awt.Container.processEvent(Container.java:2058)
at java.awt.Component.dispatchEventImpl(Component.java:4410)
at java.awt.Container.dispatchEventImpl(Container.java:2116)
at java.awt.Component.dispatchEvent(Component.java:4240)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
at java.awt.Container.dispatchEventImpl(Container.java:2102)
at java.awt.Window.dispatchEventImpl(Window.java:2429)
at java.awt.Component.dispatchEvent(Component.java:4240)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at com.kingdee.bos.invokecounter.RPCLogEventQueue.dispatchEvent(RPCLogEventQueue.java:83)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
Caused by: org.mozilla.javascript.EcmaError: TypeError: Cannot call method "getValue" of null (unnamed script#15)
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.Interpreter.interpretLoop(Interpreter.java:1515)
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$4.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.dispatchEvent(EventQueue.java:597)
at com.kingdee.bos.invokecounter.RPCLogEventQueue.dispatchEvent(RPCLogEventQueue.java:83)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:177)
at java.awt.Dialog$1.run(Dialog.java:1039)
at java.awt.Dialog$3.run(Dialog.java:1091)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Dialog.show(Dialog.java:1089)
at com.kingdee.bos.ctrl.swing.KDDialog.show(KDDialog.java:184)
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)
... 61 more
Caused by: org.mozilla.javascript.EcmaError
org.mozilla.javascript.EcmaError: TypeError: Cannot call method "getValue" of null (unnamed script#15)
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.Interpreter.interpretLoop(Interpreter.java:1515)
at script(unnamed script:15)
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$4.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.dispatchEvent(EventQueue.java:597)
at com.kingdee.bos.invokecounter.RPCLogEventQueue.dispatchEvent(RPCLogEventQueue.java:83)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:177)
at java.awt.Dialog$1.run(Dialog.java:1039)
at java.awt.Dialog$3.run(Dialog.java:1091)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Dialog.show(Dialog.java:1089)
at com.kingdee.bos.ctrl.swing.KDDialog.show(KDDialog.java:184)
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:114)
at com.kingdee.eas.ep.client.ExtendMethodInterceptor.intercept(ExtendMethodInterceptor.java:104)
at com.kingdee.eas.auto4s.vam.client.AgentServiceEditUI$$EnhancerByCGLIB$$7f65a286.beforeStoreFields(
at com.kingdee.eas.framework.client.EditUI.verify(EditUI.java:810)
at com.kingdee.eas.framework.client.EditUI.doBeforeSave(EditUI.java:768)
at com.kingdee.eas.auto4s.vam.client.AgentServiceEditUI$$EnhancerByCGLIB$$7f65a286.CGLIB$doBeforeSave$0$310(
at com.kingdee.eas.auto4s.vam.client.AgentServiceEditUI$$EnhancerByCGLIB$$7f65a286$$FastClassByCGLIB$$5195439.invoke(
at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:167)
at com.kingdee.eas.ep.client.ExtendMethodInterceptor.intercept(ExtendMethodInterceptor.java:51)
at com.kingdee.eas.auto4s.vam.client.AgentServiceEditUI$$EnhancerByCGLIB$$7f65a286.doBeforeSave(
at com.kingdee.eas.framework.client.EditUI.actionSave_actionPerformed(EditUI.java:725)
at com.kingdee.eas.framework.client.AbstractCoreBillEditUI.actionSave_actionPerformed(AbstractCoreBillEditUI.java:1052)
at com.kingdee.eas.framework.client.CoreBillEditUI.actionSave_actionPerformed(CoreBillEditUI.java:1019)
at com.kingdee.eas.auto4s.vam.client.AbstractAgentServiceEditUI.actionSave_actionPerformed(AbstractAgentServiceEditUI.java:2991)
at com.kingdee.eas.auto4s.vam.client.AgentServiceEditUI.actionSave_actionPerformed(AgentServiceEditUI.java:2484)
at com.kingdee.eas.auto4s.vam.client.AgentServiceEditUI$$EnhancerByCGLIB$$7f65a286.CGLIB$actionSave_actionPerformed$0$13(
at com.kingdee.eas.auto4s.vam.client.AgentServiceEditUI$$EnhancerByCGLIB$$7f65a286$$FastClassByCGLIB$$5195439.invoke(
at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:167)
at com.kingdee.eas.ep.client.ExtendMethodInterceptor.intercept(ExtendMethodInterceptor.java:51)
at com.kingdee.eas.auto4s.vam.client.AgentServiceEditUI$$EnhancerByCGLIB$$7f65a286.actionSave_actionPerformed(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.kingdee.bos.ui.face.ItemAction.reflectPerformAction(ItemAction.java:442)
at com.kingdee.bos.ui.face.ItemAction.innerActionPerformed(ItemAction.java:395)
at com.kingdee.eas.framework.client.AbstractEditUI$ActionSave.actionPerformed(AbstractEditUI.java:1200)
at com.kingdee.bos.appframework.client.servicebinding.ActionProxy.actionPerformedInvoke(ActionProxy.java:174)
at com.kingdee.bos.appframework.client.servicebinding.ActionProxy.actionPerformed(ActionProxy.java:101)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at com.kingdee.bos.ctrl.swing.KDWorkButton.fireActionPerformed(KDWorkButton.java:567)
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.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
at java.awt.Component.processMouseEvent(Component.java:6038)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3260)
at com.kingdee.bos.ctrl.swing.KDWorkButton.processMouseEvent(KDWorkButton.java:861)
at java.awt.Component.processEvent(Component.java:5803)
at java.awt.Container.processEvent(Container.java:2058)
at java.awt.Component.dispatchEventImpl(Component.java:4410)
at java.awt.Container.dispatchEventImpl(Container.java:2116)
at java.awt.Component.dispatchEvent(Component.java:4240)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
at java.awt.Container.dispatchEventImpl(Container.java:2102)
at java.awt.Window.dispatchEventImpl(Window.java:2429)
at java.awt.Component.dispatchEvent(Component.java:4240)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at com.kingdee.bos.invokecounter.RPCLogEventQueue.dispatchEvent(RPCLogEventQueue.java:83)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
学习一下!
if(pluginCtx.getKDBizPromptBox("XXX").getValue()==null&&pluginCtx.getKDTable("kdtEntrys").getRowCount()==0){
throw new com.kingdee.bos.BOSException("分录不能为空!");
}
DEP 里如何控制F7控制有值时,分录提示不能为空
本文2024-09-16 23:04:07发表“eas cloud知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-eas-52198.html