Run Updateable BAQ from customisation [C#]

it is not updating, there is no errors

private void btnRetrieve_Click(object sender, System.EventArgs args)
{
// ** Place Event Handling Code Here **
FillPendingRequests();
}
DynamicQueryAdapter yourbaq;
DataTable results;
private void FillPendingRequests()
{
yourbaq = new DynamicQueryAdapter(this.oTrans);

	yourbaq.BOConnect();
	string baqname = "Ex_PendingStkMove";

	//yourbaq.ExecuteByID(baqname, dsBAQ);
	yourbaq.GetByID(baqname);
	Ice.BO.DynamicQueryDataSet ds = yourbaq.DynamicQueryData;
	
	if (ds.DynamicQuery.Rows.Count == 0)
			{
				Ice.BO.DynamicQueryDataSet dsQDesign = yourbaq.QueryDesignData;
				DataRow targetRow;
				foreach (DataTable table in ds.Tables)
				{
					foreach (DataRow sourceRow in dsQDesign.Tables[table.ToString()].Rows)
					{
						targetRow = table.NewRow();
						targetRow.ItemArray = sourceRow.ItemArray;
						table.Rows.Add(targetRow);
					}
				}
			}

	var dsBAQ = yourbaq.GetQueryExecutionParametersByID(baqname);
	dsBAQ.AcceptChanges();
	yourbaq.Execute(ds, dsBAQ);

	if (yourbaq.QueryResults != null && yourbaq.QueryResults.Tables.Count > 0)
	{
		results = yourbaq.QueryResults.Tables["Results"];
	}
	else
	{
		results = new DataTable();
	}
	EpiDataView edv = null;
	if (!(edv != null)) { edv = (EpiDataView)oTrans.EpiDataViews[baqname]; }
		if (!(edv != null))
		{
			edv = new EpiDataView();
			oTrans.Add(baqname, edv);
		}
		edv.dataView = results.DefaultView;

	gridPendingRequests.DataSource = results;

}

private void btnCreatePack_Click(object sender, System.EventArgs args)
{
	yourbaq.Update();
	results.AcceptChanges();
	//CallMaterialQueueAdapterUpdateMethod();
}

this is my code

could you please have a look?

1 Like