I’m instantiating an adapter and getting the dataset okay. Then if I turn right around and try to run the inspection update it tells me the dataset isn’t the right kind:
InspProcessingAdapter inspProcessingAdapter = new InspProcessingAdapter(oTrans);
inspProcessingAdapter.BOConnect();
SearchOptions opts = new SearchOptions(SearchMode.AutoSearch);
opts.PreLoadSearchFilter = ""; //Company = 'DNP01'";
opts.DataSetMode = DataSetMode.RowsDataSet;
bool morePages = false;
// Erp.BO.InspProcessingDataSet
// System.Data.DataSet
var dsInspProcessing = inspProcessingAdapter.GetList(opts, out morePages);
// see whether dataset is good
string legalNumberMessage = "";
int iDMRNum = 0;
inspProcessingAdapter.InspectInventory(out legalNumberMessage, out iDMRNum, dsInspProcessing);
Error: CS1502 - line 135 (402) - The best overloaded method match for 'Erp.Adapters.InspProcessingAdapter.InspectInventory(out string, out int, Erp.BO.InspProcessingDataSet)' has some invalid arguments
Error: CS1503 - line 135 (402) - Argument 3: cannot convert from 'System.Data.DataSet' to 'Erp.BO.InspProcessingDataSet'
inspProcessingAdapter.GetRows(opts, out morePages);
//var dsInspProcessingBO = dsInspProcessing.InspProcessingData;
// see whether dataset is good
string legalNumberMessage = “”;
int iDMRNum = 0;
inspProcessingAdapter.InspectInventory(out legalNumberMessage, out iDMRNum, inspProcessingAdapter.InspProcessingData);
So using “inspProcessingAdapter.GetList(opts, out morePages)” returns almost immediately, gives me no records in the trace, dataset, or adapter.
“inspProcessingAdapter.GetRows(opts, out morePages)” takes a bit to complete, and fills the trace with data. But no records in the dataset or adapter.
If I do a “inspProcessingAdapter.GetByID(22769)” I get a single record in the dataset and adapter and one row in the grid. (A good sign, I think.)
If I follow the GetByID immediately followed by GetRows as shown below I still get only a single row (tranID 22769) in the dataset adapter and grid. The trace shows the single record retrieved with the GetByID followed by the full list of records retrieved with the GetRows.
How can it perform the GetRows and still have the data retrieved by the GetByID in the adapter? Why isn’t the adapter being populated (other than column headers) when the data’s in the trace?
Thanks,
Joe
InspProcessingAdapter inspProcessingAdapter = new InspProcessingAdapter(oTrans);
inspProcessingAdapter.BOConnect();
SearchOptions opts = new SearchOptions(SearchMode.AutoSearch);
opts.PreLoadSearchFilter = ""; //Company = 'DNP01'";
opts.DataSetMode = DataSetMode.RowsDataSet;
bool morePages = false;
// Erp.BO.InspProcessingDataSet
// System.Data.DataSet
inspProcessingAdapter.GetByID(22769);
inspProcessingAdapter.GetRows(opts, out morePages); // it doesn’t seem to matter whether this is commented
Erp.BO.InspProcessingDataSet dsInspProcessing = inspProcessingAdapter.InspProcessingData; //InspProcessingData;
MessageBox.Show("count " + dsInspProcessing.Tables[0].Rows.Count.ToString()); // count 1
MessageBox.Show("count " + inspProcessingAdapter.InspProcessingData.InspProcList.Rows.Count.ToString()); // count 1
this.grdInspection.Visible = true;
grdInspection.DataSource = inspProcessingAdapter.InspProcessingData.InspProcList; // a single row displayed (tranID 22769)
grdInspection.DataBind();
It sounds like there is a grid involved to display data and then a record loaded into the form.
Perhaps a combo of querying for records via BAQ and displaying them on the grid would work, followed by performing inspection processing adapter specific transactions via the adapter?