Dashboard customization not responding

Hi there,

I have been working on an updatable dashboard for open POs that you can update dates and unit price. I use a BPM to unapprove, make the changes, and reapprove the PO.

Some problems arise because this is not set up to do for multiple rows. Instead, I thought an ok work around would be to have the dashboard save after changing each row. Through a customization form event this somewhat works but errors still arise when other rows are not refreshed to show the real data so it thinks it is changing again if you were to click the save button.

To fix this, I thought I could save and refresh the dashboard after a row is changed. The customization will compile and save without and errors. When I restart the dashboard and make a change to a row, it crashes and Epicor is not responding no matter how long I leave it.
Here is the code that I added to save and refresh after a row change:

private void V_2044_1View1_AfterRowChange(EpiRowChangedArgs args)
	{
		// ** Argument Properties and Uses **
		// args.CurrentView.dataView[args.CurrentRow]["FieldName"]
		// args.LastRow, args.CurrentRow, args.CurrentView
		// Add Event Handler Code
		MainController.AppControlPanel.HandleToolClick("SaveTool", new Infragistics.Win.UltraWinToolbars.ToolClickEventArgs(MainController.MainToolManager.Tools["SaveTool"], null));
		MainController.AppControlPanel.HandleToolClick("RefreshTool", new Infragistics.Win.UltraWinToolbars.ToolClickEventArgs(MainController.MainToolManager.Tools["RefreshTool"], null));
	}

Is it crashing because it doesn’t finish saving before attempting to refresh or what could be the issue here?

If it’s a UBAQ and you turn multiple dirty off it will update on it’s own no UI code needed.

This does help similar to saving after every row change. The issue I am having though is when other rows are not refreshed so it attempts to save different results.

For example, I approve a PO on one line/release. If I click off the row it saves. If I do not refresh the dashboard the other lines of the same PO are still appearing as unapproved, so when I go to approve a different PO it throws an error.
But if I were to approve a PO on one line/release, click off the row, and then refresh the dashboard, then I can approve the other PO just fine.

To fix this I thought I could just get rid of the line in the customization that uses the MainController to save, but keep the RefreshTool line. This still causes Epicor to Not Respond. I actually just noticed that it could possibly come back after several minutes but no changes in the dashboard are made at all, so I do not think it is going through. Am I doing the refresh part right or is there a better way?

how long does it take to refresh if you just click refresh?

Clicking refresh also causes it to Not Respond. It takes several minutes. Did I somehow affect how the refresh is working?

How long does it take to refresh in the BAQ Designer?

In the BAQ Designer, it ‘refreshes’ almost immediately when I click Get List in Analyze if that is what you mean. When I click Update for a particular row, it brings a Null Exception error but that is a different problem I believe because it does not occur in the Dashboard and was happening before I attempted any customization on the dashboard assembly and the update is made successfully after closing the error message.

Ok so we have quick in BAQ Designer, and slow in deployed dashboard. How quickly does the dashboard refresh in the dashboard designer (non deployed copy?)

The non-deployed version in dashboard designer refreshes instantly. More interesting when I use Test Application before deploying it instantly refreshes and updates so the crashing has to be because of the customization in the deployed dashboard assembly. Many issues are still occurring when I use the test application which I am trying to solve with the customization.

If I click approve on a PO and then approve on a different PO without refreshing first it gives an error.

The table ttResults has more than one record
The table ttResults has more than one record
The table ttResults has more than one record
The table ttResults has more than one record
POHeader is not available.
The table ttResults has more than one record

Alright so we’re narrowing down where the issue is. Open the dashboard in base mode no customization how does it perform?

Is your BAQ designed with multiple dirty turned off?

I have multiple dirty row turned off in the BAQ designer. Using the base only version of the dashboard it performs the same as in Test Application. It can function and refresh for single row use but messing with multiple rows causes some errors.

So I think we have narrowed down that for sure it’s the customization causing it to lock up, that’s a good start. Can you format and post the entire customization code?

// **************************************************
// Custom code for MainController
// Created: 7/9/2020 3:28:59 PM
// **************************************************
using System;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Windows.Forms;
using Ice.BO;
using Ice.UI;
using Ice.Lib;
using Ice.Adapters;
using Ice.Lib.Customization;
using Ice.Lib.ExtendedProps;
using Ice.Lib.Framework;
using Ice.Lib.Searches;
using Ice.UI.FormFunctions;

public class Script
{
	// ** Wizard Insert Location - Do Not Remove 'Begin/End Wizard Added Module Level Variables' Comments! **
	// Begin Wizard Added Module Level Variables **

	// End Wizard Added Module Level Variables **

	// Add Custom Module Level Variables Here **

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

		this.MainController.AfterToolClick += new Ice.Lib.Framework.AfterToolClickEventHandler(this.MainController_AfterToolClick);
		this.V_2044_1View1_Row.EpiRowChanged += new EpiRowChanged(this.V_2044_1View1_AfterRowChange);
		// End Wizard Added Variable Initialization

		// Begin Wizard Added Custom Method Calls

		// End Wizard Added Custom Method Calls
	}

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

		this.MainController.AfterToolClick -= new Ice.Lib.Framework.AfterToolClickEventHandler(this.MainController_AfterToolClick);
		this.V_2044_1View1_Row.EpiRowChanged -= new EpiRowChanged(this.V_2044_1View1_AfterRowChange);
		// End Wizard Added Object Disposal

		// Begin Custom Code Disposal

		// End Custom Code Disposal
	}

	private void MainController_AfterToolClick(object sender, Ice.Lib.Framework.AfterToolClickEventArgs args)
	{
		if(args.Tool.Key == "SaveMenuTool")
		{
			MainController.AppControlPanel.HandleToolClick("RefreshTool", new Infragistics.Win.UltraWinToolbars.ToolClickEventArgs(MainController.MainToolManager.Tools["RefreshTool"], null));
		}
	}


	private void V_2044_1View1_AfterRowChange(EpiRowChangedArgs args)
	{
		// ** Argument Properties and Uses **
		// args.CurrentView.dataView[args.CurrentRow]["FieldName"]
		// args.LastRow, args.CurrentRow, args.CurrentView
		// Add Event Handler Code
		MainController.AppControlPanel.HandleToolClick("RefreshTool", new Infragistics.Win.UltraWinToolbars.ToolClickEventArgs(MainController.MainToolManager.Tools["RefreshTool"], null));
	}
}

You mean to requery the dashboard each time the row changes? You may be stuck in a loop here.

Please take a peek see at code higlighting Code Syntax Highlighting in Posts

Also listen to @Chris_Conn he knows his infinite loops!

2 Likes

I think you are right Chris. When I am refreshing, that changes a row which then causes it to refresh again and so on. What would be a better approach? My goal is to have the user avoid having to hit the save and refresh button after changing every single row.

If I told you I wasnt prepared for that repsonse I’d be lying hahahahahah

1 Like

If you can get ahold of AfterAdapterMethod for update, then you can call your refresh from there. As far as auto save, simply turn Multiple Dirty Rows off, then Epicor will auto save when you move to a new row.

1 Like

Sorry I am pretty new to customizations and epicor in general. Thanks for your help. The Adapter list in the Form Event wizard doesn’t show anything. Do you know the specific adapter I should use?

I actually figured out I had quite bigger issues. In my BAQ directive, I was using GetByID and Update incorrectly which was throwing the Null exception in the BAQ Designer. It is also why I never saw any of the message boxes pop up that I had put in the directive. Once I fixed that, It works much better and does not throw any errors. I also got rid of the infinite loop customization issue. Thanks for all your help troubleshooting this!

1 Like