I’m trying to launch the research “Pack / MP Selection” that is contained in the BOLGenerateSearchAdapter, and I having the error:
Unable to cast object of type ‘Ice.Lib.Searches.SearchOptions’ to type ‘Erp.UI.Searches.BOLGenerateSearchOptions’.
I hate to have to code the hole functionality since it already exists and it work wonderfully.
A great programmer I know told me this error means that I cannot use this search.
This happens when calling the Simple Search Wizard and when calling the code from the dashboard:
extern alias Erp_Contracts_BO_BOL;
extern alias Erp_Contracts_BO_BOLGenerateSearch;
using Erp.Adapters;
using Erp.UI;
using Erp.BO;
using Ice.Adapters;
// Please ignore the use of CallContextBpmData , at this point I just entered some code for testing but I need the selection to be available in the BOLForm Report.
private void SearchOnBOLGenerateSearchAdapterShowDialog_1()
{
// 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;
string whereClause = string.Empty;
System.Data.DataSet dsBOLGenerateSearchAdapter = Ice.UI.FormFunctions.SearchFunctions.listLookup(this.oTrans, "BOLGenerateSearchAdapter", out recSelected, true, whereClause);
if (recSelected)
{
System.Data.DataRow adapterRow = dsBOLGenerateSearchAdapter.Tables[0].Rows[0];
// Map Search Fields to Application Fields
EpiDataView edvCallContextBpmData = ((EpiDataView)(this.oTrans.EpiDataViews["CallContextBpmData"]));
System.Data.DataRow edvCallContextBpmDataRow = edvCallContextBpmData.CurrentDataRow;
if ((edvCallContextBpmDataRow != null))
{
edvCallContextBpmDataRow.BeginEdit();
edvCallContextBpmDataRow["Character01"] = adapterRow["BOLNum"];
edvCallContextBpmDataRow.EndEdit();
}
}
}
This should get you started, it’s all I have time to mess with.
I included my little object walker if you want to print out the properties for an object.