Indicate Dirty rows on Update-able Dashboard

Is there a way to highlight rows in an Updateable dashboard (with multi-dirty row enabled), that have been changed, but not yet saved?

I’m okay if “changed” row that was changed, then changed back to the original values, is highlighted - even though the new values are the same as the old ones.

I am looking to solve a similar problem. How can I indicate a row is dirty within a dashboard UBAQ? Did anyone ever figure out if this is possible?
Thanks!
Nate

Did you try row rules?

I did this with a UI customization (used the wizard).

	private void CreateRowRuleV_IGUpdate_1ViewPart_InstallGuideID_cColumnValueChanges()
	{
		// Description: Changed
		// **** begin autogenerated code ****
		RuleAction warningV_IGUpdate_1View_RowAction = RuleAction.AddRowSettings(this.oTrans, "V_IGUpdate_1View", true, SettingStyle.Warning);
		RuleAction[] ruleActions = new RuleAction[] {
				warningV_IGUpdate_1View_RowAction};
		// Create RowRule and add to the EpiDataView.
		RowRule rrCreateRowRuleV_IGUpdate_1ViewPart_InstallGuideID_cColumnValueChanges = new RowRule("V_IGUpdate_1View.Part_InstallGuideID_c", RuleCondition.ColumnValueChanges, "V_IGUpdate_1View.Part_InstallGuideID_c", ruleActions);
		((EpiDataView)(this.oTrans.EpiDataViews["V_IGUpdate_1View"])).AddRowRule(rrCreateRowRuleV_IGUpdate_1ViewPart_InstallGuideID_cColumnValueChanges);
		// **** end autogenerated code ****
	}

2 Likes

Hi Aaron,

I’m trying to recreate this in one of my updateable dashboards. Unfortunately I must be doing SOMETHING wrong as the code does not auto populate under the Script Editor when I set everything using the Row Rules Wizard.

Would you be able to show me a screen shot of how you had everything set in your Rule Wizard Tab?

Thank You!

I usually only use the Rule Wizard sheet to create the base code (the empty function, creators and destroyers, etc…). Then do all my code enty in the Script editor.

Make sure the “Custom Code” box is checked in Script editor

Thanks for the quick response Calvin :slight_smile: Below is the snippet of how I’ve set up the wizard.

Sadly, all it creates is the Initialize Custom Code section

Update - I deleted my Customization and restarted Epicor and it sees to be working fine now

1 Like

That’s an awfully long function name. Maybe its too long.

Try making a similar rule row on a view/Table and field that is shorter. If that works just use the syntax it created to manually enter the function code in Script editor.

Ok here I go Necroposting…
But it’s relevant, so I’m adding it.

RowMod can’t be used in a Row Rule, as it’s not populated when you want to be, so the checks always fail. This is how I solved this problem.

I added a “RowDirty” boolean field to my BAQ query (“Calculated_RowDirty”)

I added a Row Rule to check this field, and if it is true, highlight yellow. (“Warning”)

I added the “OnListChanged” DataView Event to the EpiDataView.dataView.

In that event, you can check for if the row is marked dirty, then you update the “RowDirty” field
in the dataview. The Row Rule then fires and does your highlight.
You must be careful in that field to only update the row once, or you could create a loop that will
crash epicor if you aren’t careful. Of course I’d add some error handling, even though there is none in the posted code.

I hope someone can find this useful.

Kevin

public void InitializeCustomCode()
{
	// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Variable Initialization' lines **
	// Begin Wizard Added Variable Initialization
	// End Wizard Added Variable Initialization
	// Begin Wizard Added Custom Method Calls

	CreateRowRuleV_KEV_ReportQCHold_1ViewCalculated_RowDirtyEquals_true(); //Create Our Highlight Row Rule

	// End Wizard Added Custom Method Calls

	ud07View.dataView.ListChanged  += new  System.ComponentModel.ListChangedEventHandler(OnListChanged); //Add Underlying DataView Event
}

public void DestroyCustomCode()
{
	// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Object Disposal' lines **
	// Begin Wizard Added Object Disposal
	// End Wizard Added Object Disposal
	// Begin Custom Code Disposal
	// End Custom Code Disposal

	ud07View.dataView.ListChanged  -= new  System.ComponentModel.ListChangedEventHandler(OnListChanged); //Clean Underlying DataView Event
}

//Our Row Rule to Highlight Dirty Rows Yellow (Checks "Calculated_RowDirty" == true, then highlight)
private void CreateRowRuleV_KEV_ReportQCHold_1ViewCalculated_RowDirtyEquals_true()
{
	// Description: DirtyRowCheck
	// **** begin autogenerated code ****
	RuleAction warningV_KEV_ReportQCHold_1View_RowAction = RuleAction.AddRowSettings(this.oTrans, "V_KEV_ReportQCHold_1View", true, SettingStyle.Warning);
	RuleAction[] ruleActions = new RuleAction[] {
			warningV_KEV_ReportQCHold_1View_RowAction};
	// Create RowRule and add to the EpiDataView.
	RowRule rrCreateRowRuleV_KEV_ReportQCHold_1ViewCalculated_RowDirtyEquals_true = new RowRule("V_KEV_ReportQCHold_1View.Calculated_RowDirty", RuleCondition.Equals, true, ruleActions);
	((EpiDataView)(this.oTrans.EpiDataViews["V_KEV_ReportQCHold_1View"])).AddRowRule(rrCreateRowRuleV_KEV_ReportQCHold_1ViewCalculated_RowDirtyEquals_true);
	// **** end autogenerated code ****
}


//The magic happens here. Any row changed will fire this event immediately. No worries about unreliable BeforeRowChange, AfterRowChange events.
private void OnListChanged(object sender,  System.ComponentModel.ListChangedEventArgs args)  
{ 
	if(args.ListChangedType.ToString() == "ItemChanged")
	{
		//args.OldIndex & args.NewIndex are the same here
		DataRow row = ud07View.dataView[args.OldIndex].Row;
		
		//Keep this here or else you will create an infinite loop and a hard crash.
		//We are checking if the row is already marked dirty, if it is, leave it alone, or you create a loop.
		if( Convert.ToBoolean(row["Calculated_RowDirty"]) == false) 
		{
			row["Calculated_RowDirty"] = true; //This will trigger the row rule.
		}
	}
}