Setting a default combo box on a Dashboard

I have a dashboard with a number of combo boxes that need to have a default. Some of these were added in the tracker, the others I had to add in the customization. The BAQCombo’s defaulted without issue, but I stuck on defaulting an Ice.Lib.Framework.EpiCombo, Erp.UI.Controls.Combos.SalesCatCombo, and Erp.Adapters.Controls.PlantCombo.
What is the best path to get them to default? I have tried setting the Value, DisplayMember and ValueMember, and setting the EpiDataView(-1 index error).

To set the trackers, you’ll need to go directly to the controls and set them there.

//put this in model level variables
YourControlType YourControlName;

//in initialize custom code
YourControlName = (YourControlType)csm.GetNativeControlReference("YouControlGuidHere");

YourControlName.Value = yourValue //this is for number fields
YourControlName.Text = "yourValue" //this is for string fields

this code was just typed by hand, so sorry if there are any typos

Because it’s bound to the grid dataview (which isn’t populated on load), you can’t set them with that dataview like you would on other controls. (I figured this out recently because I’m doing the same thing)

1 Like

That is how I have done the other combos and its worked great. but for some reason these few don’t want to work.

Erp.UI.Controls.Combos.SalesCatCombo SalesCat = null;
		Ice.Lib.Framework.EpiCombo SalesChannel = null;
		SalesCat = (Erp.UI.Controls.Combos.SalesCatCombo)csm.GetNativeControlReference("8f3b1f96-89ae-4f22-bb55-ec6660a8434d");
		SalesChannel = (Ice.Lib.Framework.EpiCombo)csm.GetNativeControlReference("6fbae8e7-0514-43a4-8d4a-f82cc58f39a2");
		SalesChannel.Value = "Inside Sales";
		SalesChannel.Text = "Inside Sales";
	    SalesCat.Value = "Direct Sales"; 
		SalesCat.Text = "Direct Sales";

Those are the ID’s of what’s in the drop down? Or that’s the description? It needs to be the ID

EDIT: After looking, yeah that ID is only 4 characters long, so that’s no the right thing to set it to.

What I ended up doing is removing the filters that the Tracker generated and added my own BAQ combo boxes in the Customize Tracker view. After I did this, I was able to default them without issue in the Customization layer.