Skip to content

Instantly share code, notes, and snippets.

@strepicor
Last active September 13, 2022 08:56
Show Gist options
  • Save strepicor/31230c546e3da0b4185f20f531def2e2 to your computer and use it in GitHub Desktop.
Save strepicor/31230c546e3da0b4185f20f531def2e2 to your computer and use it in GitHub Desktop.
Epicor Customization - Retrive filtered data from Adaptor
private void CallUserCodesAdapterGetListMethod()
{
// Declare and Initialize EpiDataView Variables
// Declare and create an instance of the Adapter.
UserCodesAdapter adapterUserCodes = new UserCodesAdapter(this.oTrans);
adapterUserCodes.BOConnect();
// Build where clause for search.
string whereClause = "CodeID = \'1\'";
System.Collections.Hashtable whereClauses = new System.Collections.Hashtable(1);
whereClauses.Add("UDCodes", whereClause);
// Call the adapter search.
SearchOptions searchOptions = SearchOptions.CreateRuntimeSearch(whereClauses, DataSetMode.RowsDataSet);
adapterUserCodes.InvokeSearch(searchOptions);
var dr = adapterUserCodes.UserCodesData.UDCodes[0];
//Or Call Adapter method-----------------------------------------------------------------------
//System.Boolean morePages;
//System.Data.DataSet dsUserCodes = adapterUserCodes.GetRows(searchOptions, out morePages);
//-------------------------------------------------------------------------------------------
// Cleanup Adapter Reference
adapterUserCodes.Dispose();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment