mnemec
(Michael Nemec)
October 5, 2020, 10:21pm
1
I’ve created a defined parameter for fiscal year, and I’ve set to skip if empty. However, when I don’t enter anything in the field, the BAQ is automatically entering a 0, which of course brings back no results:
Does anyone know why that’s happening?
Thanks,
Mike
Arul
(Arul Shankar)
October 5, 2020, 10:31pm
2
Do you need data from multiple years ? If not, add a customization to default to current Fiscal Year.
mnemec
(Michael Nemec)
October 5, 2020, 10:35pm
3
I’d like to give the user the opportunity to choose.
mnemec
(Michael Nemec)
October 5, 2020, 10:48pm
4
Curiously though, how would I add a customization to simply pull from the most recent date (year/period)?
Arul
(Arul Shankar)
October 5, 2020, 11:25pm
5
Below is the Epicor 9 code for your reference. Use std. wizard to call FiscalPerSearch and pass criteria.
private void BAQReportForm_Load(object sender, EventArgs args)
{
// Add Event Handler Code
SearchOnFiscalPerSearchAdapterShowDialog() ;
}
private void SearchOnFiscalPerSearchAdapterShowDialog()
{
// Wizard Generated Search Method
// You will need to call this method from another method in custom code
// For example, [Form]_Load or [Button]_Click
bool recSelected;
DateTime date = new DateTime(DateTime.Today.Year, 1, DateTime.Today.Month);
DateTime? lDate = date.Date.AddDays(-1) ;
string whereClause = "FiscalCalendarID = '" + "CompCal" + "' and StartDate <= '" + lDate +
"' and EndDate >= '" + lDate + "'" ;
System.Data.DataSet dsFiscalPerSearchAdapter = Epicor.Mfg.UI.FormFunctions.SearchFunctions.listLookup(this.oTrans, "FiscalPerSearchAdapter", out recSelected, false, whereClause);
if (recSelected)
{
System.Data.DataRow adapterRow = dsFiscalPerSearchAdapter.Tables[0].Rows[0];
// Map Search Fields to Application Fields
EpiDataView edvReportParam = ((EpiDataView)(this.oTrans.EpiDataViews["ReportParam"]));
System.Data.DataRow edvReportParamRow = edvReportParam.CurrentDataRow;
if ((edvReportParamRow != null))
{
edvReportParamRow.BeginEdit();
edvReportParamRow["Field1"] = adapterRow["FiscalYear"];
edvReportParamRow["Field2"] = adapterRow["FiscalPeriod"];
edvReportParamRow.EndEdit();
}
}
}
These Parameters will not work on a BAQ Report. Are you hoping to use it on a Dashboard? If so, I would offer to not use Parameters, but use the Tracker View Filter instead. That allows for a lot more flexability.
If this will be for a Report, you will be able to use the filters in BAQ Report (not as parameters). Or, you can make a custom report and use the parameters there.
1 Like
Arul
(Arul Shankar)
October 6, 2020, 5:01am
8
Yes, it’s not as a parameter but as a filter.