postmanplod
Programmer
Hello,
We added a new sheet to the Part screen called 'Design' with some fields, two of which are Part.CheckBox10 and Part.NetWeight. We now want to put a rule in place to state: When Part.Check10 = True, Then Part.NetWeight is disabled, else Part.NetWeight is enabled. I first attempted via the Row Rules but then noticed the newly created Design does not appear under views. I then attempted via the script editor using the following code from the rule:
Private Sub CreateRowRuleGlbPartCheckBox10Equals_TrUE
Dim disabledGlbPart_NetWeight As RuleAction = RuleAction.AddControlSettings(oTrans, "GlbPart.NetWeight", SettingStyle.Disabled)
Dim ruleActions As RuleAction() = new RuleAction() {disabledGlbPart_NetWeight}
Dim rrGlbPartCheckBox10Equals_TrUE As RowRule = New RowRule("CheckBox10", RuleCondition.Equals, True, ruleActions)
CType(oTrans.EpiDataViews("Design"), EpiDataView).AddRowRule(rrGlbPartCheckBox10Equals_TrUE)
End Sub
However, I then recevie the following error:
Error Detail
============
Exception has been thrown by the target of an invocation.
Stack Trace
===========
at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Epicor.Mfg.UI.Customization.CustomScriptManager.initCustomAssembly(Assembly assm)
Inner Exception
===============
Object reference not set to an instance of an object.
Inner Stack Trace
=================
at Script.CreateRowRulePartCheckBox10Equals_TrUE()
at Script.InitializeCustomCode()
Any ideas?
Regards,
Michael
We added a new sheet to the Part screen called 'Design' with some fields, two of which are Part.CheckBox10 and Part.NetWeight. We now want to put a rule in place to state: When Part.Check10 = True, Then Part.NetWeight is disabled, else Part.NetWeight is enabled. I first attempted via the Row Rules but then noticed the newly created Design does not appear under views. I then attempted via the script editor using the following code from the rule:
Private Sub CreateRowRuleGlbPartCheckBox10Equals_TrUE
Dim disabledGlbPart_NetWeight As RuleAction = RuleAction.AddControlSettings(oTrans, "GlbPart.NetWeight", SettingStyle.Disabled)
Dim ruleActions As RuleAction() = new RuleAction() {disabledGlbPart_NetWeight}
Dim rrGlbPartCheckBox10Equals_TrUE As RowRule = New RowRule("CheckBox10", RuleCondition.Equals, True, ruleActions)
CType(oTrans.EpiDataViews("Design"), EpiDataView).AddRowRule(rrGlbPartCheckBox10Equals_TrUE)
End Sub
However, I then recevie the following error:
Error Detail
============
Exception has been thrown by the target of an invocation.
Stack Trace
===========
at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Epicor.Mfg.UI.Customization.CustomScriptManager.initCustomAssembly(Assembly assm)
Inner Exception
===============
Object reference not set to an instance of an object.
Inner Stack Trace
=================
at Script.CreateRowRulePartCheckBox10Equals_TrUE()
at Script.InitializeCustomCode()
Any ideas?
Regards,
Michael