# Epi button to refresh embedded BAQ

**URL:** <https://www.epiusers.help/t/epi-button-to-refresh-embedded-baq/70601>\
**Category:** Epicor ERP 10\
**Tags:** customization\
**Created:** [September 3, 2020, 4:50pm UTC](https://www.epiusers.help/t/epi-button-to-refresh-embedded-baq/70601 "2020-09-03T16:50:02Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![jorel](https://www.epiusers.help/letter_avatar_proxy/v4/letter/j/f19dbf/32.png) [@jorel](https://www.epiusers.help/u/jorel)\
**Post date:** [September 3, 2020, 5:04pm UTC](https://www.epiusers.help/t/epi-button-to-refresh-embedded-baq/70601/2 "2020-09-03T17:04:06Z")

</div>

> [@Grid Property Changed](https://www.epiusers.help/t/grid-property-changed/49825/22):
>
> You shouldn’t have to, it subscribes to the top grid and when you change the top grid it automatically re-runs the query. However if you want to force it to refresh (IE you add more data somewhere else) you can do this //Add this using at the top of your class using System.Reflection; //On "Refresh" or button click MethodInfo mi = bdvLeaveUsage.GetType().GetMethod("invokeExecute", BindingFlags.Instance | BindingFlags.NonPublic); mi.Invoke(bdvLeaveUsage, new object[]{ true });

Place an epibutton on the form. Then use the Event Wizards to the button click event like so…  
 ![image](https://www.epiusers.help/uploads/default/original/3X/b/6/b66c4b5e8aabe9894c059900601d21532888e562.png)  
In the event handling code section, insert the code Jose provided in the above post. (Make sure you change the baqDataView to yours). Also make sure you add the “using” statement to the top.

---

_[View the full topic](https://www.epiusers.help/t/epi-button-to-refresh-embedded-baq/70601)._
