Can someone please tell me if I am adding this CommonRule incorrectly, syntactically? I cannot find any examples of this rule being used in any sample code or forums. I think its a simple syntax error but I am unsure. I ended up writing my own custom rule to do what this built in rule does and I'm not happy about doing this. I want to use the CommonRule.
ValidationRules.AddRule(CommonRules.IntegerMinValue, new CommonRules.IntegerMinValueRuleArgs("ModifiedBy", 1));
bones:ValidationRules.AddRule(AddressOf CommonRules.IntegerMinValue, new CommonRules.IntegerMinValueRuleArgs("ModifiedBy", 1));
Here's the error I am getting:
Tests.AccountContactFixture.GetAccountsContactsByAccount : AI.Core.DataPortalException : DataPortal.Fetch failed (System.ArgumentException: Property Get method was not found.
at System.Reflection.RuntimePropertyInfo.GetValue(Object obj, BindingFlags invokeAttr, Binder binder, Object[] index, CultureInfo culture)
at System.Reflection.RuntimePropertyInfo.GetValue(Object obj, Object[] index)
at AI.Core.Utilities.CallByName(Object target, String methodName, CallType callType, Object[] args)
at AI.Core.Validation.CommonRules.IntegerMinValue(Object target, RuleArgs e)
at AI.Core.Validation.RuleMethod.Invoke(Object target)
at AI.Core.Validation.ValidationRules.CheckRules(List`1 list)
at AI.Core.Validation.ValidationRules.CheckRules()
at AI.Library.CustomerRelationshipManagement.AccountContact..ctor() in C:\Documents and Settings\acardoza\My Documents\Visual Studio 2005\Projects\AI.Library.CustomerRelationshipManagement\Engine\AccountContact.cs:line 228
at AI.Library.CustomerRelationshipManagement.AccountContact.Get(IDataReader dr) in C:\Documents and Settings\acardoza\My Documents\Visual Studio 2005\Projects\AI.Library.CustomerRelationshipManagement\Engine\AccountContact.cs:line 216
at AI.Library.CustomerRelationshipManagement.AccountContactCollection.DataPortal_Fetch(Criteria crit) in C:\Documents and Settings\acardoza\My Documents\Visual Studio 2005\Projects\AI.Library.CustomerRelationshipManagement\Engine\AccountContactCollection.cs:line 186)
----> AI.Core.Server.CallMethodException : DataPortal_Fetch method call failed
----> System.ArgumentException : Property Get method was not found.
You know what, you are right. I am upgrading someone else's code so I haven't really combed through it thoroughly enough yet. But that's exactly it.
It probably helps to read the exceptions more carefully!
Thanks!
Copyright (c) Marimer LLC