Hiii,
I’ve been trying to filter out my updatable BAQ by passing in a parameter. Within the returned values, I can then make certain modifications as necessary. This is my code right now…
private void testButton_Click(object sender, System.EventArgs args)
{
// ** To Test making changes to a BAQ **
dynamicQueryAdapter = new DynamicQueryAdapter(oTrans);
dynamicQueryAdapter.BOConnect();
var dqds = dynamicQueryAdapter.GetQueryExecutionParametersByID("test_minh5");
dqds.ExecutionParameter[0].ParameterID = "jobTitle";
dqds.ExecutionParameter[0].ParameterValue = "test";
dqds.AcceptChanges();
bool more;
var ds = dynamicQueryAdapter.GetList("test_minh5", dqds, 0, 0, out more);
DataRow row = ds.Tables[0].Rows[0];
MessageBox.Show("ds.Tables[0].Rows.Count " + ds.Tables[0].Rows.Count );
row["UD15_Character06"] = "pls work";
row["RowMod"] = "U";
dynamicQueryAdapter.Update("test_minh5", ds);
}
The code works fine with no errors, but the filter is not working, as in, I still get my entire table returned.
As for how I set up my BAQ …
this is the SQL used to fetch it…
and this is the table criteria (when I manually do it, a form appears which allows me to enter the ‘jobTitle’ param → this works fine and returns me the rows I expect).
I am not sure why your specific example is not working. I often use parameters in my custom code to filter my BAQs. In this example, I am filtering a BAQ that feeds a combo box.
In this example, my BAQ is called “getPartRev”. I have a parameter in the BAQ called ‘part’. The code just populates that parameter based on the value in the previous part field. I use the results of the filtered BAQ to populate the combobox with the revisions for the part number that was previously selected. The main difference I can see is that I am using ExecuteByID.
Sorry I couldn’t be more help. Good luck!