On my Quote Entry form I have a customization that basically populates an Ultra Grid with some BAQ data upon button click. I have successfully gotten the grid to clear on events such as “Clear Tool” clicked, or certain field changes like CustID. However, I have done some research into this on google and in the forums and can’t quite come to a solution for clearing the grid when the user changes the Quote on the form from one to another. I tried looking for “QuoteNum” field change events but these did not work.
What kind of event fires when a user completely changes the Quote record from one to another in the Quote Entry form?
Epicor 10.2.400. I am successfully clearing my grids on other events with grid.DataSource = null and grid.Refresh(). Just looking for the right spot to place these commands so it clears when the quote record changes.
Do you need it to be triggered on a button or could you code it as a BAQDataView and subscribe it to your quote data. Then that change of quote would also update your grid.
So, great response Joshua and thank you for the follow up question. The reason I am allowing the user to click a button when they are ready to pull in the data from the BAQ as opposed to on loading a quote is because it will add a small slow down to loading a quote in our already highly customized form. Also, the data relies on the CustID field being populated for the BAQ to properly run so that is one of the pre-requisites.
Not a bad idea though if I cannot find a way to effectively clear the grid when the quote record is changed from one to another. The BAQ is dealing with Quote data for the selected CustID and some of ours have an extensive history of quote data and take longer than others so I didn’t want to burden the original quote loading process with the execution of the BAQ to give the illusion of efficiency.
Sorry for going kind of stream of consciousness on you here.
So in that case you might be able to use AfterAdapterMethod and look for a GetByID or OnChangeCustID or something like that. Or possibly ListChanged I would play around with some of those event options I can never remember which one is the one to use for this case, and it can be different depending on how Epicor has coded their stuff and in what order. I’m thinking though AfterAdapterMethod is your best bet.
Okay Joshua, I was able to accomplish what was requested in my original post (I think it’s been like 10 minutes? Incredible help here.) using the information you provided me.
Solution:
private void oTrans_adapter_AfterAdapterMethod(object sender, AfterAdapterMethodArgs args)
{
// ** Argument Properties and Uses **
// ** args.MethodName **
// ** Add Event Handler Code **
// ** Use MessageBox to find adapter method name
// EpiMessageBox.Show(args.MethodName)
switch (args.MethodName)
{
case "GetByID":
//DH Clear Quote Margin Analysis Grid Data when Quote Record Changes
ClearQuoteMarginGrids();
break;
}