Row Rule to show Open Releases that are late

I want to highlight **OPEN **releases that are LATE, but not Closedreleases.

I have done the standard rules - but I need to do a custom condition.

Where would I go to get the syntax to put logic for
OrderRel.OpenRelease=“Open” and OrderRel.ReqDate < Today

Here’s what I have tried
Make all release Invisable then set the late releases to warning.

private void CreateRowRuleOrderRelOpenReleaseEquals_FALSE()
{
	// Description: ReleaseClosed
	// **** begin autogenerated code ****
	ControlSettings controlSettings1EpiStyle_Invisible = new ControlSettings();
	controlSettings1EpiStyle_Invisible.SetStyleSetName("EpiStyle_Invisible");
	RuleAction epistyle_invisibleOrderRel_RowAction = RuleAction.AddControlSettings(this.oTrans, "OrderRel.", controlSettings1EpiStyle_Invisible);
	RuleAction[] ruleActions = new RuleAction[] {
			epistyle_invisibleOrderRel_RowAction};
	// Create RowRule and add to the EpiDataView.
	RowRule rrCreateRowRuleOrderRelOpenReleaseEquals_FALSE = new RowRule("OrderRel.OpenRelease", RuleCondition.Equals, false, ruleActions);
	((EpiDataView)(this.oTrans.EpiDataViews["OrderRel"])).AddRowRule(rrCreateRowRuleOrderRelOpenReleaseEquals_FALSE);
	// **** end autogenerated code ****
}

private void CreateRowRuleOrderRelReqDateLessThan_Constant_Today()
{
	// Description: DatePriortoToday
	// **** begin autogenerated code ****
	RuleAction warningOrderRel_ReqDate = RuleAction.AddControlSettings(this.oTrans, "OrderRel.ReqDate", SettingStyle.Warning);
	RuleAction[] ruleActions = new RuleAction[] {
			warningOrderRel_ReqDate};
	// Create RowRule and add to the EpiDataView.
	RowRule rrCreateRowRuleOrderRelReqDateLessThan_Constant_Today = new RowRule("OrderRel.ReqDate", RuleCondition.LessThan, "Constant: Today", ruleActions);
	((EpiDataView)(this.oTrans.EpiDataViews["OrderRel"])).AddRowRule(rrCreateRowRuleOrderRelReqDateLessThan_Constant_Today);
	// **** end autogenerated code ****
	// Create RowRule and add to the EpiDataView.
	RowRule rrCreateRowRuleOrderRelOpenReleaseEquals_FALSE = new RowRule("OrderRel.OpenRelease", RuleCondition.Equals, false, ruleActions);
	((EpiDataView)(this.oTrans.EpiDataViews["OrderRel"])).AddRowRule(rrCreateRowRuleOrderRelOpenReleaseEquals_FALSE);
	// **** end autogenerated code ****
}

If this is a dashboard, I have had luck adding another column to the BAQ with desired highlight set there. Lots easier (for me) to do it in the query than in the Grid Properties dialog / code.

1 Like

I wish it was a dashboard
It’s a customization on the order entry screen.
there is a way to do this, just need to understand how to write the code.

Your easiest route is to make another column and call it IsLate if its BAQ Calculated_IsLate do some basic CASE statement and then do a row rule to color the date for any IsLate = 'Y’

2 Likes

Well I had to figure this out for something else. Its actually pretty easy though not documented well anywhere that I can find. In the Row Rules wizard, choose Custom Condition.
image

Then write your logic, eg:

	private bool MtlSugNumber011_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
		
		//Highlight material PO suggestions for jobs, where we have some inventory on-hand 
		if (args.Row["JobNum"].ToString() != "" &&
			Convert.ToDecimal(args.Row["Number01"]) > 0) {

			result = true;
		}

		return result;
	}

Use of the args.Row argument isn’t documented anywhere afaik. Customization guide only touches on arg1. args.Row is an array of objects that need to be converted to the right data type. I’m not a professional coder so someone else might need to clarify/correct me.

Hope this helps

1 Like

You could also low tech it and have the first rule set the late releases to yellow and then a second rule that sets the closed releases to grey. No code required!