Customization to insert value to UD feild using BAQ updatable

Hi All,
As I said from topic, I want to update data into BAQ Update but can’t. I need some advise.

My code as below:

private void oTrans_groupAdapter_BeforeAdapterMethod(object sender, BeforeAdapterMethodArgs args)
	{
		
		switch (args.MethodName)
		{
			case "Update":{
				// ** Place Event Handling Code Here **
				EpiDataView edvRcvDtl = (EpiDataView)oTrans.EpiDataViews["APInvHed"];
 				 if (edvRcvDtl != null && edvRcvDtl.Row > -1)
  				{
   				 DataRowView rcvRow = edvRcvDtl.dataView[edvRcvDtl.Row];
  				  string param = rcvRow["GroupID"].ToString();
  				  DynamicQueryAdapter dqadptr = new DynamicQueryAdapter(oTrans);
   				 dqadptr.BOConnect();
   				 string baqname = "BAQ_UpdateReport_c";
   				 Ice.BO.QueryExecutionDataSet dsBAQ = dqadptr.GetQueryExecutionParametersByID(baqname);
   				 dsBAQ.ExecutionParameter[0].ParameterID = "GroupID";
   				 dsBAQ.ExecutionParameter[0].IsEmpty = false;
				 dsBAQ.ExecutionParameter[0].ParameterValue = param;
   				 dsBAQ.AcceptChanges();
   				 dqadptr.ExecuteByID(baqname, dsBAQ);
   				 DataTable results = dqadptr.QueryResults.Tables["Results"];
   				 if (results != null && results.Rows.Count > 0)
   				 {
     				 // some code to arrive at your next lot number - round trip to int with Int32.TryParse and back to string?
     				   rcvRow.BeginEdit();
				   rcvRow["Description"] = "Test Update";
     				   rcvRow.EndEdit(); 
				   dqadptr.Update(baqname, results.DataSet);
				   results.AcceptChanges();
   				 }
					
   				 results = null;
    				dqadptr.Dispose();
  				}
				break;
			}
		}

	}

You’re not updating anything in the dataset you are sending.

Do you have any idea to fix my case? Or can you show me how to do an example?

rcvRow is what you are updating.

If you want to update the uBAQ data wouldn’t it be the results or data that is in dqadptr?

1 Like

Yes, it’s. I just want to know how to update Description field with the uBAQ .

rcvRow["Description"] = "Test Update";

I am confused now. Your first comment is asking about updating the uBaq.

Or are you trying to update the current dataview with the uBAQ data?