Hoping this is the last little bit of code that needs debugging for 10.1.400 upgrade to 10.2.300.
This is our last form customization that needs to verify.
Warning: CS0618 - line 730 (2265) - ‘Ice.Lib.ExtendedProps.RowRule.RowRule(object, Ice.Lib.ExtendedProps.RowRuleConditionDelegate, object, Ice.Lib.ExtendedProps.RuleAction[])’ is obsolete: ‘Use the constructor that takes a RowRuleConditionDelegate2 instead’
private static void CreateRowRulePartShortChar01CustomCondition_Constant_NullValue()
{
//disable piece qty on line item screen if dimensional and multiple releases
RuleAction disabledPODetail_Number04 = RuleAction.AddControlSettings(oTrans, "PODetail.Number04", SettingStyle.Disabled);
RuleAction[] ruleActions = new RuleAction[] {disabledPODetail_Number04};
RowRule rrPartShortChar01CustomCondition_Constant_NullValue = new RowRule("Part.ShortChar01", PartShortChar01ConstantNullValue_CustomRuleCondition, "None", ruleActions);
((EpiDataView)oTrans.EpiDataViews["PODetail"]).AddRowRule(rrPartShortChar01CustomCondition_Constant_NullValue);
}
I’d take a look at the declaration of PartShortChar01ConstantNullValue_CustomRuleCondition
If you replace it with RuleCondition.Equals, then it appears to work.
I agree with AndrewM, I am not even sure why you are specifying PartShortChar01ConstantNullValue_CustomRuleCondition, do you want to handle the Validation Logic yourself?
Since there is no error\null checking you could reduce your func to this below. However, I think those fields are nullable, so if I were you, I’d check the value for null.
I am going to punt on warning for now.
I tested the functionality in the UI that this routine is tied to and things are working as expected thus far.
So since this is just a warning and this is a DEV environment, I’ll just work with things as they are and address later.
I did find that replacing the declaration with RuleCondition.Equals allows things to compile correctly.
I have not tried so skinny up function yet… I would want to know how to check for the nulls as mentioned when I get around to that part.
There are many ways, this one is pretty straight forward. By using a try/catch block, we trap any errors. Since the default result is false, if an error occurs (like the field is null), you get a false.
bool result = false;
try
{
result = (bool)PODetail.dataView[PODetail.Row]["MultiRel"];
} catch{}
return result;
In your case, it’s probably not an issue, but in many cases you can run into errors, like if no row is selected (or has been deleted without being updated) and some fields wont have a value and would throw a null error when trying to cast them to a desired type.