Populate Dashboard UltraComboBox list via code or query

Not sure if I am trying something that sounds simple but is not possible.

Our quality team are wanting to use the E10 employee training module to manage and track employee training. Whilst basic this module seems to meet our need and they are cracking on with this. What they have noticed is that there are very few reports/trackers for this module and they have asked me to look at this.

Rather than creating an SSRS report I have created a baq and built a simple filterable dashboard and this works ok. However I have been asked if the filter for training course name can be changed from the text box that it defaults to - ideally to a pre-populated list of possible training courses. I could manually type these into the list but if I understand the end users correctly they want this to by dynamic so courses will appear in the filter as the course records are created. I thought that this would be a skoosh with an ultracombo however…

I have done plenty of research and messing about but I can’t see any simple way of populating the ultra combox box within the dashboard - I don’t seem to have the wizards options to bring in a simple search adaptor, that I would have if this was an ultra combo on a form customisation - I’m not sure if this is a limitation of the dashboard creation tools?

I’m guessing that this can be done using c# but I’m a total beginner so wouldn’t know where to start on this and I’m guessing that this is getting into populating and returning an array of values.

Does anyone know of a simple way of populating an ultracombobox used on a dashboard with values from a query or a table?

Any help will be greatly appreciated. We are on 10.0.7.4,

Create a BAQ (yourBAQ) to generate a list of training courses

Add an UltraCombo (yourUltraCombo) with EpiBinding to the filter field.

Use the Event Wizard on the BeforeDropDown event to add the following code.

private void yourUltraCombo_BeforeDropDown(object sender, System.ComponentModel.CancelEventArgs args)
{
	// ** Place Event Handling Code Here **
	try
	{ 
		DynamicQueryAdapter queryAdapter = new DynamicQueryAdapter(this.oTrans);
		queryAdapter.BOConnect();
		string queryID = "yourBAQ";  <--- BAQ to retrieve list of training courses
		queryAdapter.ExecuteByID(queryID);

		yourUltraCombo.DataSource = queryAdapter.QueryResults.Tables["Results"];

	}
	catch (System.Exception ex) 
	{ 
		ExceptionBox.Show(ex); 
	}
}
3 Likes

Option #2

If the list of training courses are already available through an adapter, a EpiCombo can be used and configured to the values you want…

Brian thanks for the suggestions.

We don’t do lots of customisations so I am knew to this but what I am seeing is

By default all of the procedure/functions on the dashboard script are set to public static void. If I remove the static property it then starts throwing up this error when I test code

Error: CS1061 - line 59 (307) - ‘Script’ does not contain a definition for ‘oTrans’ and no extension method ‘oTrans’ accepting a first argument of type ‘Script’ could be found (are you missing a using directive or an assembly reference?)

If I try and do the same thing with an ultracombibox in the creen training course schedule maintenance the code complies and runs.

It looks like there is no adaptor to allow me to use your epicombo suggestion. However if I create an epicombo and go to tools | wizards | customization wizards I can connect to this table using a simple search adaptor. If I try and do the same thing on the dashboard I don’t get the wizards option under tools so can’t go any further.

All references etc are the same in both pieces of code.

Is there a limitation on what you can do with code/combos etc in dashboards versus traditional form customisations?

What I would do in this scenario is use User Codes. These are just parent/child relationship lists. You would create a Code Type called TrainingCourses, and then you (or others if you allow) can just add records to the User Codes tables using its maintenance screen. This makes it much more dynamic, and will update every instance where the list gets used.

The EpiCombo box has the option to link to the UDCodes Adapter, you just need to filter it for the specific CodeTypeID that you created. Search CodeTypeID on the forum for the syntax.