I have created a baq that uses 4 fields basically a vendor ID two dates and displays invoice numbers to keep it simple it displays a few more but those are irrelevant. When you run the baq it runs another baq that that populates the vendor IDs in the first drop down, then it has a start and end date field where the user can put a range of dates to filter invoice that match the supplier ID. I would like to use this baq to populate a grid in an existing tracker I created a new grid inside a new form inside the existing tracker called supplier tracker in the accounts payable module. What is the most logical way to run this query and match the vendor ID to the supplier the tracker is tracking/subscribed to, and display in the grid I have a button that I have used some code but it does not work:
Blockquote
// **************************************************
// Custom code for VendorForm
// Created: 3/9/2022 9:33:42 AM
// **************************************************
using System;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Windows.Forms;
using Erp.UI;
using Ice.Lib.Customization;
using Ice.Lib.ExtendedProps;
using Ice.Lib.Framework;
using Ice.Lib.Searches;
using Ice.Adapters;
using Ice.BO;
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 **
Ice.Lib.Framework.EpiUltraGrid dateRangeGrid;
public void InitializeCustomCode()
{
// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Variable Initialization' lines **
// Begin Wizard Added Variable Initialization
// End Wizard Added Variable Initialization
// Begin Wizard Added Custom Method Calls
this.btnAddDates.Click += new System.EventHandler(this.btnAddDates_Click);
// End Wizard Added Custom Method Calls
//dateRangeGrid = (Ice.Lib.Framework.EpiUltraGrid)csm.GetNativeControlReference ("92393695-0603-49cb-8ad3-5f91647c0dc7");
//dateRangeGrid.DipslayLayout.Bands(0).Columns.Add("InvoiceDate", "Invoice Date");
//dateRangeGrid.InitizializeRow += new Infragistics.Win.UltraWinGrid.InitializeRowEventHandler(grdMatLst_InitializeRow);
}
private void grdMatLst_InitializeRow(Object sender, Infragistics.Win.UltraWinGrid.InitializeRowEventArgs e)
{
}
public void DestroyCustomCode()
{
// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Object Disposal' lines **
// Begin Wizard Added Object Disposal
this.btnAddDates.Click -= new System.EventHandler(this.btnAddDates_Click);
// End Wizard Added Object Disposal
// Begin Custom Code Disposal
// End Custom Code Disposal
}
private void btnAddDates_Click(object sender, System.EventArgs args)
{
// ** Place Event Handling Code Here **
DynamicQueryAdapter dqa = new DynamicQueryAdapter(oTrans);
dqa.BOConnect();
QueryExecutionDataSet qeds = dqa.GetQueryExecutionParametersByID("JBIS-SupInvLkUpDates");
qeds.ExecutionParameter.Clear();
qeds.ExecutionParameter.AddExecutionParameterRow("@FromDate", dtStartDate.ToString() , "date",false, Guid.NewGuid(),"d");
qeds.ExecutionParameter.AddExecutionParameterRow("@ToDate", dtEndDate.ToString() , "date",false, Guid.NewGuid(),"d");
ugInvRange.DataSource = dqa.QueryResults.Tables["Results"];
}
}
Blockquote