roywebs
(Roy Brodavo)
August 25, 2020, 8:59pm
1
I am converting (from E9 to E10) this code and not getting any error but I am not getting any data return. But I am guessing it is something to do with GetDashboardQuery . However, I am not sure what is the replacement for E10. What is the new information to replace the code?
Thanks.
gridContacts.DataSource =new DataTable();
string BAQ = session.CompanyID + "-ARInvoice_Mailer_Head";
**DynamicQueryAdapter queryAdapter = new DynamicQueryAdapter(oTrans);**
** queryAdapter.BOConnect();**
** queryAdapter.GetDashboardQuery(BAQ);**
** DataView dv = new DataView(queryAdapter.RuntimeQuery.Tables[“QueryTable”]);**
string filter ="";
if (txtCustID.Text.Trim().Length > 0)
{
filter = AddFilter("", "Customer.CustID=", txtCustID.Text.Trim(), true);
dv.RowFilter = "DataTableName='Customer'";
dv[0]["WhereClause"] = filter;
}
queryAdapter.ExecuteBAQDataViewQuery(queryAdapter.RuntimeQuery);
DataTable dt = queryAdapter.QueryResults.Tables["Results"];
gridHeader.DataSource = dt;
Carson
(Carson Ripple)
August 26, 2020, 1:46pm
2
Change this:
To this:
DataView dv = new DataView(queryAdapter.QueryResults.Tables[“Results”]);
1 Like
roywebs
(Roy Brodavo)
August 27, 2020, 6:44pm
3
Thanks, I will give this a try and see if that works
roywebs
(Roy Brodavo)
August 27, 2020, 8:04pm
4
This did not work. Still not getting any results. It seems to be stuck at the “Retrieving data…”.
It seems that this part of the code work for E9, but E10 threw and error at runtime saying Column name “DataTableName” cannot be found.
What would the replacement for E10?
Carson
(Carson Ripple)
August 28, 2020, 1:36pm
5
Are you filtering the dataview based on the textbox value?
Then the syntax would be:
if (txtCustID.Text.Trim().Length > 0)
{
dv.RowFilter = String.Format("Customer_CustID = '{0}'", txtCustID.Text.Trim());
}
roywebs
(Roy Brodavo)
September 2, 2020, 5:49pm
6
Thank you @Carson that suggested change worked.
roywebs
(Roy Brodavo)
September 3, 2020, 9:38pm
7
If I have a list of values in a datatable grid and a column name “Selected” and want to assign all the selected ones to a list, how would you go about doing that?
In E9 it was done this way:
DataRow[] invoiceList = ((DataTable)gridHeader.DataSource).Select(“Selected=true”);
But this is throwing error that “Cannot find column [Selected]”.
Chris_Conn
(Chris Conn)
September 4, 2020, 12:53am
8
You need to figure out what the name of the column is, “Selected” can be the caption, but its the ID you need. Have a look at the Columns.