My last questions still apply, but for what it’s worth, I traced the error in VS. The problem is with the line:
adapter.BOConnect();
So I swapped out a bit of code. This little bit seems to work to seet the callcontextbpmdata fields.
// set callcontextbpmdata fields to textbox values
EpiDataView edvCallContextBpmData = ((EpiDataView)(this.oTrans.EpiDataViews["CallContextBpmData"]));
System.Data.DataRow edvCallContextBpmDataRow = edvCallContextBpmData.CurrentDataRow;
edvCallContextBpmDataRow["ShortChar01"] = epiTextBoxC2.Value.ToString();
edvCallContextBpmDataRow["Character01"] = epiTextBoxC3.Value.ToString();
Now the error is farther down. I have seen this before, and I am sure Chris and Daryl will recognize it from my previous posts.
Can’t find query definition in passed dataset.
This occurs when I try to run the custom action in the BAQ. Here is my updated code for the second button.
private void epiButtonC2_Click(object sender, System.EventArgs args)
{
// ** Place Event Handling Code Here **
// Make sure New ID and Description text fields are populated
if (epiTextBoxC2.Value.ToString() == "")
{
MessageBox.Show("Please enter a new Resource Group ID.");
return;
}
if (epiTextBoxC3.Value.ToString() == "")
{
MessageBox.Show("Please enter a new Resource Group Description.");
return;
}
// set callcontextbpmdata fields to textbox values
EpiDataView edvCallContextBpmData = ((EpiDataView)(this.oTrans.EpiDataViews["CallContextBpmData"]));
System.Data.DataRow edvCallContextBpmDataRow = edvCallContextBpmData.CurrentDataRow;
edvCallContextBpmDataRow["ShortChar01"] = epiTextBoxC2.Value.ToString();
edvCallContextBpmDataRow["Character01"] = epiTextBoxC3.Value.ToString();
//? Do I need to close or otherwise deactivate the job before making operation changes?
// Run custom code to change resource group ID for open jobs from old to new res grp id
// Run custom code to update op description and res grp description to new description
// Run code to update entire record and validate changes
DynamicQueryAdapter dqa = new DynamicQueryAdapter(this.oTrans);
DataTable results;
results = new DataTable();
dqa.BOConnect();
string baqname = "ChangeOpenJobResGrpIDs";
Ice.BO.DynamicQueryDataSet dqDS = dqa.DynamicQueryData;
dqa.RunCustomAction(dqDS, "ChangeResGrpID", results.DataSet, true);
dqa.Update(dqDS, results.DataSet);
LoadMyBAQ("ChangeOpenJobResGrpIDs", epiUltraGridC1);
}
This is similar to the error I am still encountering from one of my lasts posts:
For some reason .Update and .RunCustomAction calls are failing with the same error. My dataset is not properly defined, and I am not clear on why.
I am still trying to figure out the solution to both problems. A good solution here could kill both of these posts! Thanks!
Nate