Hi everyone,
I am attempting to create a row rule using a custom condition. In the wizard it looks like this;
I put 5 in the rule value because that is what was done in the Customization User Guide
This is the auto generated code with my condition added. I eventually want to compare with 2 UD fields, ie; greater than UD field 1 and less than UD field 2, but as I can not even get past the first hurdle I have hard coded values instead.
private void CreateRowRuleQuoteDtlDocInExpUnitPriceCustomCondition_5()
{
// Description: Low Price
// **** begin autogenerated code ****
RuleAction warningQuoteDtl_DocExpUnitPrice = RuleAction.AddControlSettings(this.oTrans, "QuoteDtl.DocExpUnitPrice", SettingStyle.Warning);
RuleAction[] ruleActions = new RuleAction[] {
warningQuoteDtl_DocExpUnitPrice};
// Create RowRule and add to the EpiDataView.
RowRule rrCreateRowRuleQuoteDtlDocInExpUnitPriceCustomCondition_5 = new RowRule("QuoteDtl.DocInExpUnitPrice", new RowRuleConditionDelegate2(this.QuoteDtlDocInExpUnitPrice5_CustomRuleCondition), 5, ruleActions);
((EpiDataView)(this.oTrans.EpiDataViews["QuoteDtl"])).AddRowRule(rrCreateRowRuleQuoteDtlDocInExpUnitPriceCustomCondition_5);
// **** end autogenerated code ****
}
private bool QuoteDtlDocInExpUnitPrice5_CustomRuleCondition(Ice.Lib.ExtendedProps.RowRuleDelegateArgs args)
{
bool result = false;
// ** RowRuleDelegateArgs Properties: args.Arg1, args.Arg2, args.Context, args.Row
// ** put Row Rule condition evaluation logic here
double price = System.Double.Parse(args.Arg1.ToString());
if ((price >= 100) && (price <= 150))
{
return true;
}
return result;
}
The code compiles but nothing happens when the DocExpUnitPrice is changed to a value between 100 and 150.
Thanks in advance
Adrian