We have a dashboard with a customization that includes a button to launch the Build Project Analysis. Currently, it’s coded to pass only one value for ProjectID from the grid, even if multiple rows are selected. How do I code it to pass multiple ProjectIDs to the Process Caller? Thanks.
Here’s a more general question: is it possible to select multiple values of any (searchable) field, from a BAQ result grid or a dashboard, and then pass them through the context menu? Like in this image, if I just query the ProjCstHistory table, select a few projects, then right click and open with Project Tracker, only the one Project ID that I actually right clicked on gets passed over. Same with Build Project Analysis or any other process.
I figured out how to do this, and I’ll explain how.
I ran a trace log just on the Build Project Analysis and loaded multiple ProjectIDs. I saw this interesting line from the trace:
400712~400713~400715~400729~400733~400736~400739
It led me to suspect the underlying BO took not multiple input parameters, but a single string value parameter composed of ProjectID concatenated with tildes. So then I asked, how do I construct such a string within the dashboard customization to pass to the Process Caller? Well, this is how:
private void btnBuildProjAnls_MouseClick(object sender, System.Windows.Forms.MouseEventArgs
args)
{
LaunchFormOptions opts = new LaunchFormOptions();
try
{var dataRows = RRHeader.Selected.Rows; //RRHeader is the grid in question
string projectIDString = "";
foreach(Infragistics.Win.UltraWinGrid.UltraGridRow gridRow in dataRows)
{
projectIDString = projectIDString + "~" + gridRow.Cells["ProjectCst_ProjectID"].Value.ToString();
}
opts.ValueIn = projectIDString.Substring(1); //Have to trim off the leading ~
ProcessCaller.LaunchForm(oTrans,"Erp.UIProc.GenerateAnalysis.dll", opts);
}
catch{}
}
It works! What do y’all think?