UBAQ Dashboard "Get List" after item delete

Hello EpicUsers.

I’ve successfully used this post to help me delete items from UD01 via my Dashboard:
https://www.epiusers.help/t/delete-rows-ud-table/52534\

I’m using the Invoke BO Method widget.
It all executes great!
But the user still has to refresh the Dashboard to see the item go away.
I want to take care of that step.

Is there another widget in the BPM Directives Configuration that I can use in-line after the Invoke BO Method to essentially “Get List” in the BAQ after my DeleteByID is finished?

Or is that something I need to take care of in the Dashboard?

image

My dashboard is using this Action Buttons to trigger the Delete in the “Run Custom” in the UBAQ, FYI.

Any help to get this to the finish line is appreciated.
Thanks,
Ben

I do this in the dashboard customization. In the custom code, you can call this function to refresh the dashboard just like clicking the refresh button.

private void RefreshPage()
{
MainController.AppControlPanel.HandleToolClick("RefreshTool", new Infragistics.Win.UltraWinToolbars.ToolClickEventArgs(MainController.MainToolManager.Tools["RefreshTool"], null));
}

I have also used this one to refesh all the BAQs on a dash in case ther are more than one.

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);

}
1 Like

Thanks Nate!

Can I tie that code to the action of clicking the “Action Buttons”?

Here is the a portion of the trace:

  <businessObject>Ice.Proxy.BO.DynamicQueryImpl</businessObject>
  <methodName>RunCustomAction</methodName>
  <appServerUri>net.tcp://dsepicorapp10/EpicorERP10/</appServerUri>
  <returnType>System.Data.DataSet</returnType>
  <localTime>5/19/2022 11:16:08:7687148 AM</localTime>
  <threadID>1</threadID>
  <executionTime total="77" roundTrip="72" channel="0" bpm="0" other="5" />
  <retries>0</retries>
  <parameters>
    <parameter name="queryDS" type="Ice.BO.DynamicQueryDataSet">
      <DynamicQueryDataSet xmlns="http://www.epicor.com/Ice/300/BO/DynamicQuery/DynamicQuery" />
    </parameter>
    <parameter name="actionID" type="System.String"><![CDATA[Delete]]></parameter>
    <parameter name="queryResultDataset" type="System.Data.DataSet">
      <QueryResultDataSet />
    </parameter>
  </parameters> ```

Yes, I think so. You would do that in the dashboard customization. You should be able to find button click events. I use some code like this to trigger my custom action, then I would trigger the refresh after this.

private 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");
    BindingFlags bf = BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static | BindingFlags.FlattenHierarchy;
    MethodInfo mi = t.GetMethod("BAQRunCustomAction", bf);
    object[] param = new object[] { BAQView, iActionID};
    mi.Invoke("Ice.Lib.Framework.BAQUpdater", param);
}

Nate,
Thanks for your help!

I put your code for Page Refresh under this event:

It works, but for every toolclick, not the specific one I am targeting.

Any idea how I can target the one I looking for?

image

It is from the “Action Buttons” I added.

I see what you are showing by adding an EpiButton and that custom code. I get that. I know you are showing me a solution.
I’m hoping to add to the action I have already trained on.

Thanks,
Ben

Now THAT is a good question. I have tried to link into the custom action on the menu, but I didn’t have any luck. I think that is why I went with my own button to execute the custom action, and then execute the refresh. I would love to hear anyone else’s solutions for this! Good luck!

1 Like

If all else fails, I’ll build the EpiButton.
Just hoping for this solution.

So It look like you can get at the tool type with something like this:

	private void MainController_AfterToolClick(object sender, Ice.Lib.Framework.AfterToolClickEventArgs args)
	{
	MessageBox.Show(args.Tool.Key.ToString());
	}

This should show you the name of the tool you clicked on. You can then use that name to set your criteria. When I ran this, my custom action tool in the menu came up as “ViewButton1”. So I would set up something like this:

	private void MainController_AfterToolClick(object sender, Ice.Lib.Framework.AfterToolClickEventArgs args)
	{
	if (args.Tool.Key.ToString() == "ViewButton1")
{
//Do refresh code
}

	}

I am not sure about the timing of this. Not sure if the custom action will run before the refresh code, or after. If the custom action runs after the refresh then you may be stuck with making your own button.

1 Like

That is perfect!
THANK YOU!!!

My working code:

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

Nate, if you 're at Insights next week, I’ll buy you a drink (if that’s your thing)
Ben

1 Like

Not this time. Maybe, someday! You can give my drink to @josecgomez . He’s the real hero!

1 Like