Hi everyone.
Hopefully, someone can help. I have the code below which compile with no errors but when it runs there are no rows in the dtJobStatus table. Can anyone tell me where I have gone wrong?
Thanks in advance
Adrian.
private void getJobStatus()
{
EpiDataView edvOrderDtl = ((EpiDataView)(this.oTrans.EpiDataViews["OrderDtl"]));
System.Data.DataRow edvOrderDtlRow = edvOrderDtl.CurrentDataRow;
if (currentOrder != (int)edvOrderDtlRow["OrderNum"]);
{
currentOrder = (int)edvOrderDtlRow["OrderNum"];
if (edvOrderDtlRow != null)
{
DynamicQueryAdapter dqa = new DynamicQueryAdapter(oTrans);
dqa.BOConnect();
QueryExecutionDataSet qeds = dqa.GetQueryExecutionParametersByID("Job-Status");
qeds.ExecutionParameter.Clear();
qeds.ExecutionParameter.AddExecutionParameterRow("Job-Status", currentOrder.ToString(), "nvarchar", false, Guid.NewGuid(), "A");
dqa.ExecuteByID("Job-Status", qeds);
dtJobStatus = dqa.QueryResults.Tables["Results"];
if (dtJobStatus.Rows.Count > 0)
{
int row = 0;
for (row = 0; row < edvOrderDtl.dataView.Table.Rows.Count - 1; row++ )
{
edvOrderDtl.dataView.Table.Rows[row]["tbIssued_c"] = dtJobStatus.Rows[row]["Calculated_Message"].ToString();
}
}
dqa.Dispose();
}
}
}
Hari_Dutt
(Hari Dutt)
August 21, 2020, 10:47am
2
Adrian_Mepham:
private void getJobStatus()
{
EpiDataView edvOrderDtl = ((EpiDataView)(this.oTrans.EpiDataViews["OrderDtl"]));
System.Data.DataRow edvOrderDtlRow = edvOrderDtl.CurrentDataRow;
if (currentOrder != (int)edvOrderDtlRow["OrderNum"]);
{
currentOrder = (int)edvOrderDtlRow["OrderNum"];
if (edvOrderDtlRow != null)
{
DynamicQueryAdapter dqa = new DynamicQueryAdapter(oTrans);
dqa.BOConnect();
QueryExecutionDataSet qeds = dqa.GetQueryExecutionParametersByID("Job-Status");
qeds.ExecutionParameter.Clear();
qeds.ExecutionParameter.AddExecutionParameterRow("Job-Status", currentOrder.ToString(), "nvarchar", false, Guid.NewGuid(), "A");
dqa.ExecuteByID("Job-Status", qeds);
dtJobStatus = dqa.QueryResults.Tables["Results"];
if (dtJobStatus.Rows.Count > 0)
{
int row = 0;
for (row = 0; row < edvOrderDtl.dataView.Table.Rows.Count - 1; row++ )
{
edvOrderDtl.dataView.Table.Rows[row]["tbIssued_c"] = dtJobStatus.Rows[row]["Calculated_Message"].ToString();
}
}
dqa.Dispose();
}
}
}
Please share the Job-Status baq.
Hi @Hari_Dutt ,
Here is the output from the BAQ;
Hari_Dutt
(Hari Dutt)
August 21, 2020, 11:11am
4
Please export the baq and attach.
Ah, I see. sorry.
Job-Status.baq (45.8 KB)
tsmith
(Tyler Smith)
August 21, 2020, 11:35am
6
When you add the parameter to the BAQ call, the first string parameter needs to be the name of the BAQ Parameter, not the BAQ itself. It looks like it should be:
qeds.ExecutionParameter.AddExecutionParameterRow("OrderNumber",currentOrder.ToString(), "nvarchar", false, Guid.NewGuid(), "A");
1 Like
Thanks Tyler, that fixed it