I ask myself this question everyday.
In this particular case, I think it was a holdover from when I tried to create a dashboard with 2 UBAQs. More than one UBAQ in a Dashboard?
I was working on that project just before I started this one, so I began the same way. Creating a blank DB (dashboard) with empty tracker view to contain everything.
After considering the ‘why’, I went back and created a new dashboard based on my uBAQ. The new DB contains a native grid view that is a summary of my uBAQ. The DB also contains an empty tracker view, so I have a place to drop my textbox (to gather the new ResGrpID), and a button to execute the custom action.
I made both the grid summary and the tracker view ‘updatabale’, and I added the action to the action button list in each.
When I run the DB, first I am prompted to fill in the parameter that is required for the uBAQ to run. After I select the Old Resource Group ID from the dropdown list, the uBAQ populates the grid summary with the few jobs/ops that I want to update.
Now I just need my custom action to run the way it does from the BAQ designer. I have tried both my epiButton, and the custom action button on the action menu. Both seem to execute the custom action because my message boxes appear. The ttResults table also seems to be populated, as I can see the values in my message boxes. However, as the action reaches the end, no records are being updated.
I have made a few edits to my customization code.
private void epiButtonC2_Click(object sender, System.EventArgs args)
{
// ** Place Event Handling Code Here **
// Make sure New ID text field is populated
if (String.IsNullOrEmpty(epiTextBoxC2.Text) == true)
{
MessageBox.Show("Please enter a new Resource Group ID.");
return;
}
// set callcontextbpmdata fields to textbox values
EpiDataView edvCallContextBpmData = ((EpiDataView)(this.oTrans.EpiDataViews["CallContextBpmData"]));
System.Data.DataRow edvCallContextBpmDataRow = edvCallContextBpmData.CurrentDataRow;
edvCallContextBpmDataRow["ShortChar01"] = epiTextBoxC2.Text;
// Run custom code to change resource group ID and desc
var edv = oTrans.Factory("V_ChangeOpenJobResGrpIDs_1View");
BAQRunCustomAction(edv, "ChangeResGrpID");
}
private void BAQRunCustomAction(EpiDataView iEdv, string iActionID) //unchanged
{
BAQDataView BAQView = (BAQDataView)iEdv;
Assembly assembly = Assembly.LoadFrom("Ice.Lib.EpiClientLib.dll");
Type t = assembly.GetType("Ice.Lib.Framework.BAQUpdater");
BindingFlags bf = BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static | BindingFlags.FlattenHierarchy;
MethodInfo mi = t.GetMethod("BAQRunCustomAction", bf);
object[] param = new object[] { BAQView, iActionID};
mi.Invoke("Ice.Lib.Framework.BAQUpdater", param);
}
For what its worth, I have attached the dashboard definition, along with the uBAQ. I also attached the customization for the dashboard. Is this enough to get this setup on your end? I will be happy to post all of this again once it works as expected.
ChangeResGrpID_DashTest1.dbd (244.9 KB)
App.ChangeResGrpIDs2.MainController_Customization_Custom1_CustomExport.xml (38.3 KB)