Dashboard Refresh Does Not Refresh

Good afternoon,
I have a rather complex dashboard that has two UBAQs. The updatable part is only so I can check off some flags to tell the system which rows to process. The UBAQs work just fine. The dashboard works alright too. With one exception. When I refresh the dashboard, the most recent data is not always returned. If I refresh two or three times, I will eventually get the updated data populated.

The UBAQ in question closes an open sales order release based on which row you check off. After processing the BAQ action, I can see in the Sales Order that the releases have been closed, but the grid in the dashboard still shows the old records.

I don’t think the UBAQ code is an issue. I think it must be with the dashboard customization code.
Here is the code from the dashboard customization:

private void epiButtonC1_Click(object sender, System.EventArgs args)
	{
		//Call Actions
		oTrans.PushStatusText("Running Custom Actions...", false);
		//check to see if there are any boxes checked in OurUnmatched, if so, then execute custom action
		oTrans.PushStatusText("Processing commands for our unmatched orders...", false);
		//V_OurUnmatchedOrders_faster_1View
		var edv = oTrans.Factory("V_OurUnmatchedOrders_faster_1View");
		BAQRunCustomAction(edv, "ProcessCommands");
		//check to see if there are any boxes checked in Unmatched, if so, then execute custom action
		oTrans.PushStatusText("Processing commands for unmatched orders...", false);
		//V_OpenOrders_1View
		edv = oTrans.Factory("V_CTEOpenOrders_1View");
		BAQRunCustomAction(edv, "ProcessCommands");
		//Call Dash Refresh All
		RefreshAllBAQs();
	}

	void RefreshAllBAQs()
	{
		oTrans.PushStatusText("Refreshing all views. Please be patient...", false);      
		MainController.AppControlPanel.HandleToolClick("RefreshAllTool", new 
		Infragistics.Win.UltraWinToolbars.ToolClickEventArgs(MainController.MainToolManager.Tools["RefreshAllTool"], null)); 
		oTrans.PushStatusText("Done!", false);	
	}
	
	 void BAQRunCustomAction(EpiDataView iEdv, string iActionID)
	{
	    BAQDataView BAQView = (BAQDataView)iEdv;
	    Assembly assembly = Assembly.LoadFrom("Ice.Lib.EpiClientLib.dll");
	    Type t = assembly.GetType("Ice.Lib.Framework.BAQUpdater");
	    MethodInfo mi = t.GetMethod("BAQRunCustomAction", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static | BindingFlags.FlattenHierarchy);
		mi.Invoke("Ice.Lib.Framework.BAQUpdater", new object[]{BAQView, iActionID});
	}

I have confirmed that I am referencing the correct data view, and that my UBAQs have the correct custom actions in place. The custom actions work fine. It is just that the dashboard grid doesn’t update when I click the button.

When I click the button, I expect the UBAQ custom action to execute (it does) and then I expect the dashboard to refresh all. It does do this, but the refresh returns the wrong data at least once or twice before returning the correct data.

I did also try adding RefreshAllBAQs() three times in a row, since that is what we literally do using the refresh button on the dashboard. This didn’t help. It looks like it only refreshes once, or if it did three times it was too fast to see. Sometimes this doesn’t work either, and I have to close the dashboard and reopen it to see the updated data.

Has anyone seen anything like this before? I think an update in the last 6 months did this.
Thanks for your time!
Nate

1 Like

Usually in my custom actions, I just change the data in the dataset as I do it, so I don’t need to refresh the BAQ.

In my custom action the datasets are all separate from the dataset in the BAQ grids. That is to say, the only work I do on the rows in the BAQ grid would be to uncheck the flag box that the user checked. As a way of choosing which rows to process, and a way for the BPM to know which rows have been completed. I guess, instead of just changing the flag in the BAQ grid’s dataset, I could remove that row from the dataset.

But that only shows me what I want to see, and not the objective truth. I still want the BAQ grids to refresh and show the results accurately. Does that make sense?

Before some recent work I did to optimize the BAQs, refreshing them was painfully slow. So we would only refresh a few times while processing the records. Now that it is faster, I can imagine a more responsive dashboard that updates to show the results of the BAQs in nearly real-time.

In the past all I needed was that one command to refresh the dashboard and update all the BAQs on it. Did I miss something that changed with the way this code works?
Thanks!!

I rebuilt my dashboard by re-adding the BAQs, and updating the EpiGuids in my custom code. This seems to have fixed the updating issue! I can’t say how or why. I would love to have a programmatic approach to this instead of a lucky break!