Hello, I’m trying to find a way to pass multiple parameters to a BAQ and get the results back. I’ve only had to do one in the past, which I accomplished with widgets.
By getting the executionParameters, Updating the ID/Value of the parameter, giving the BAQ the executionParametersDataset, and then pulling the returned value using code. (See below)
I get the executionparametersdataset in the same way as before, then execute that code, then invoke the BAQ as before, and try to pull hours. It seems to take the parameters, but it returns 0 for all values… but if i type the values in manually I get the actual results(In the BAQ itself)
This is not exactly what you asked for, but I have passed parameters to a BAQ from a customized form. In C# I customized the form with this code:
private void CheckForCheckedOut()
{
//If this part/rev is checked out to the current user's eco group, then display warning.
EpiDataView edv = (EpiDataView)this.oTrans.EpiDataViews["CallContextClientData"];
string myUserString = edv.dataView[0]["CurrentUserId"].ToString();
DynamicQueryAdapter dqa = new DynamicQueryAdapter(oTrans);
dqa.BOConnect();
QueryExecutionDataSet qeds = dqa.GetQueryExecutionParametersByID("getPartRevECOs");
qeds.ExecutionParameter.Clear();
qeds.ExecutionParameter.AddExecutionParameterRow("part", txtMyPart.Text, "nvarchar", false, Guid.NewGuid(), "A");
qeds.ExecutionParameter.AddExecutionParameterRow("rev", revCombo.Text, "nvarchar", false, Guid.NewGuid(), "A");
qeds.ExecutionParameter.AddExecutionParameterRow("ECOGroup", myUserString, "nvarchar", false, Guid.NewGuid(), "A");
dqa.ExecuteByID("getPartRevECOs", qeds);
if (dqa.QueryResults.Tables["Results"].Rows.Count > 0)
{
// This part is checked out! Flag the screen and show the warning.
lblCheckedOutWarning.Visible = true;
}
else
{
lblCheckedOutWarning.Visible = false;
}
}
I am not sure if that will help with your BPM, but it is possible! I think the important part here is that my BAQ (getPartRevECOs) already has the three parameters required. This code just sets the values for those parameters. The main difference I can see is that you are using “U” to update the parameter row, and I used “A” to add the parameter row.
Good luck!
I ended up figuring it out using just the widgets, when I was setting the query, I changed the parameterID to the two other ones, and set the values seperately, so its basically just three update row widgets to get the correct parameters.