I want to trigger button click event with data of UD102A child table. When I tries to use searchwizard, it calls adapter of ud102 but I am getting only header rows. Any way to do that?
Dear Vishal,
You can call the UD102A adapter and search the data by using below mentioned code
private void CallUD101AdapterGetRowsMethod()
{
try
{
UD101Adapter adapterUD101 = new UD101Adapter(this.oTrans);
adapterUD101.BOConnect();
Epicor.Mfg.UI.Searches.SearchOptions opts = new SearchOptions(SearchMode.AutoSearch);
string whereClause = “Key1 = '” + “NG00000313” + “’”;
bool MorePages = false;
opts.DataSetMode = DataSetMode.ListDataSet;
opts.NamedSearch.WhereClauses.Add(“UD101”, String.Format(whereClause));
System.Data.DataSet dsUD101 = adapterUD101.GetRows(opts, out MorePages);
adapterUD101.Dispose();
} catch (System.Exception ex)
{
ExceptionBox.Show(ex);
}
}
Thanks Hari but I need Searhfrom not just do autosearch
UD102Adapter adapterUD102 = new UD102Adapter(this.oTrans);
adapterUD102.BOConnect();
Ice.Lib.Searches.SearchOptions opts = new SearchOptions(SearchMode.ShowDialog);
string whereClause = ""; //“Key1 = '” + “NG00000313” + “’”;
bool MorePages = true;
opts.DataSetMode = DataSetMode.RowsDataSet;
opts.NamedSearch.WhereClauses.Add("UD102A", String.Format(whereClause));
adapterUD102.InvokeSearch(opts);
with that I can retrieve UD102 data not UD102A. May be we can do this by quick search
Not sure if this sparks an idea. But I’ve done a Runtime Search in the past, never tried to see if a dialog will open.
private string GetVehicleName(string oem_key, string vehicle_key)
{
// create Hashtable of tableName
System.Collections.Hashtable myHash = new System.Collections.Hashtable();
string wClause = "Key1 = '" + oem_key + "' and ChildKey1 = '" + vehicle_key + "'";
// add table name (key) and where clause to Hashtable
myHash.Add("UD100A", wClause);
// Create SearchOptions object
SearchOptions opts = Ice.Lib.Searches.SearchOptions.CreateRuntimeSearch(myHash, DataSetMode.RowsDataSet);
// Call Adapter InvokeSearch()
ud100Adapter.InvokeSearch(opts);
if (ud100Adapter.UD100Data.UD100A.Rows.Count > 0)
{
return ud100Adapter.UD100Data.UD100A[0]["Character01"].ToString();
}
return "";
}
I always prefer Quick Search
private void btnJob_Click(object sender, System.EventArgs args)
{
// Quick Search I do keep a , delimited calculated field so I can get 3 values in my split versus just the 1. But you might just need 1.
object selected = ProcessCaller.InvokeAdapterMethod(oTrans.EpiBaseForm, "QuickSearchAdapter", "ShowQuickSearchForm", new object[] {
oTrans.EpiBaseForm, "XYZ-JobsReadyForProcessing", false /* multi-select */, new DataTable()
});
// Got Record?
if (selected != null)
{
string jobNum = selected.ToString().Split(',')[0];
string partNum = selected.ToString().Split(',')[1];
string partRev = selected.ToString().Split(',')[2];
}
}
If you do allow for multi-select then you will handle it w/ something like:
ArrayList selections = selected as ArrayList ?? new ArrayList { selected.ToString() };
selections.Sort(); // ASC
foreach (string row in selections)
{
}
Hi Haso,
Quick Search works for me. But usually Quick Search returns only one column but in what way you are returning 3 values and do split later to get all 3 values?
I just make a Calculated Column called Calculated_KeyValues in my BAQ that the QS calls and then in there I add 3 Columns and then I set that as my return column on Quick Search.
If you don’t need 3, 4, 5, 6 returned to your data set you don’t have to do as I do. I guess I could have even returned JobNum and then gotten the details using BO,Adapter, but I decided to save on the call.
okay I got it. Thanks Haso for your replies
No, unless you replicate the entire Quick Search Panel or atleast a big portion of it.