UI Customization; Dashboard Sheet

I think a workaround might be to make a new (or modify existing) BAQ to use the EmployeeID as a parameter. If your BAQ returns the proper results in the designer when you type the employee as a parameter, you’ll get the same results in the code. Of course, you could just have your BAQ built to get only the current EmployeeID record right out of the gate by using BAQ special constant CurrentEmployeeID and bypass the parameter altogether.

For the dashboard, modify it to be blank. Then open the dashboard and customize it. Add a blank UltraGrid and then use dynamic query adapter to populate it (get EmpId and pass as parameter). We’d basically be leveraging the dashboard as a free form (thanks to @josecgomez for this idea) and handling the rest manually.

Here is some code I use to call a BAQ with parameter and feed it to a grid (in your case you’d get Session.EmployeeID - I think that’s what it’s called):

//---- Setup printer list-----
DynamicQueryAdapter dqa = new DynamicQueryAdapter(oTrans);
dqa.BOConnect();
QueryExecutionDataSet qeds = dqa.GetQueryExecutionParametersByID("Printer_By_Company_CC");
qeds.ExecutionParameter.Clear();
qeds.ExecutionParameter.AddExecutionParameterRow("COMPANY",((Ice.Core.Session)oTrans.Session).CompanyID,"nvarchar",false,Guid.NewGuid(),"A");
dqa.ExecuteByID("Printer_By_Company_CC",qeds);
//MessageBox.Show(dqa.QueryResults.Tables["Results"].Rows.Count.ToString());
if(dqa.QueryResults.Tables["Results"].Rows.Count > 0)
{
//SET TO GRID HERE........
PrinterGrid.DataSource = dqa.QueryResults;
//PrinterGrid.DataSource = dqa.QueryResults.Tables["Results"]; this works too

It doesn’t make sense that the BAQView wouldn’t populate… is you BAQ SUUUPER BIG in terms of Data?

@josecgomez – I don’t think it’s SUUUER BIG… 687 rows, 6 columns. Runs in 55 ms. I’m going to try doing the same thing in a different screen and see what happens. Maybe there’s something funky going on in Office MES?

@Chris_Conn, thanks for the other idea, I’ll see if I can make any headway using that as well.

It seems like it should be an easy task to add this simple BAQ to a screen…

1 Like

I think something weird is going on In Office MES, as I never seem to get any data in either a BAQ grid or a dashboard sheet.

I decided I was making this more complicated then is needed to be there was no real reason to have to add it to Office MES, except for that it was one place to go to verify times and clock out.

So to simplify things and just deploy a dashboard that has a filter for CurrentEmployeeID. Quick & easy and now I can take another thing off my list.

Thanks again @josecgomez & @Chris_Conn for your assistance.

2 Likes

I’m curious if any of the technical limitations of MES could be affecting this? For example, a certain adapter or query not being available\disabled. I’m just thinking out loud.