# How to get a combo box to trigger another combo box?

**URL:** <https://www.epiusers.help/t/how-to-get-a-combo-box-to-trigger-another-combo-box/64676>\
**Category:** Epicor ERP 10\
**Tags:** e10\
**Created:** [February 19, 2020, 9:14pm UTC](https://www.epiusers.help/t/how-to-get-a-combo-box-to-trigger-another-combo-box/64676 "2020-02-19T21:14:16Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![dr\_wogz](https://www.epiusers.help/letter_avatar_proxy/v4/letter/d/b2d939/32.png) [@dr\_wogz](https://www.epiusers.help/u/dr_wogz)\
**Post date:** [February 19, 2020, 9:14pm UTC](https://www.epiusers.help/t/how-to-get-a-combo-box-to-trigger-another-combo-box/64676/1 "2020-02-19T21:14:17Z")

</div>

HI,

OK, am new to programming, so the syntax eludes me.

I have one combo box, that sets a part number string based off a look up table (those I can do!) But I want to be able to have a check box that ether allows this, or allows for a manual part entry, and override the part number string.

it shouldn’t be hard to do.

the two combo boxes should have a line of code that says:  
if check box = true, then PCLookup “table”, “value”…  
else variables = user input string;

How do I get the combo box to act if the check box is true / false

---

<div class="post-metadata">

**Author:** ![Mark\_Wonsil](https://www.epiusers.help/user_avatar/www.epiusers.help/mark_wonsil/32/51594_2.png) [@Mark\_Wonsil](https://www.epiusers.help/u/Mark_Wonsil)\
**Post date:** [February 19, 2020, 9:26pm UTC](https://www.epiusers.help/t/how-to-get-a-combo-box-to-trigger-another-combo-box/64676/2 "2020-02-19T21:26:21Z")

</div>

You can disable a control based on a value of another control. You can set the Checkbox and then use the Disable formula property to enable or disable the ComboBox or the Text box (for the part number) based on the value of the checkbox.

Will that work?

Later, you’ll want logic that selects the combo box value or the text box value for your part based on the value of your checkbox.

---

<div class="post-metadata">

**Author:** ![jgiese.wci](https://www.epiusers.help/user_avatar/www.epiusers.help/jgiese.wci/32/51553_2.png) [@jgiese.wci](https://www.epiusers.help/u/jgiese.wci)\
**Post date:** [February 19, 2020, 9:34pm UTC](https://www.epiusers.help/t/how-to-get-a-combo-box-to-trigger-another-combo-box/64676/3 "2020-02-19T21:34:33Z")

</div>

You can try using dataview information before dropdown, or you can use special filtering syntax in the properties window of dropdowns, but I don’t remember it. I think that’s Epicor documented somewhere

```auto
private void epiComboC2_BeforeDropDown(object sender, System.ComponentModel.CancelEventArgs args)
                {
                                // **Place Event Handling Code Here**
                                                                EpiDataView edv = oTrans.Factory("Contact");
                                                                
                                                                epiComboC2.Rows.ColumnFilters["CodeID"].FilterConditions.Clear();
                                                                epiComboC2.Rows.ColumnFilters["CodeID"].FilterConditions.Add(Infragistics.Win.UltraWinGrid.FilterComparisionOperator.StartsWith,edv.dataView[edv.Row]["ShortChar03"]);
                                                                
                }

```

---

<div class="post-metadata">

**Author:** ![dr\_wogz](https://www.epiusers.help/letter_avatar_proxy/v4/letter/d/b2d939/32.png) [@dr\_wogz](https://www.epiusers.help/u/dr_wogz)\
**Post date:** [February 19, 2020, 9:41pm UTC](https://www.epiusers.help/t/how-to-get-a-combo-box-to-trigger-another-combo-box/64676/4 "2020-02-19T21:41:56Z")

</div>

Uhm, sure?!

Yeah, I get that I can control things, and in this case one will control the other, and either allow for a user input or read it off a table.

If check mark = false, then read off the table  
if check mark =true, then allow user to input a string, and substitute that string in place of string from table.

I just don’t know how to write that in C#… or what I’m missing in the expression…

return Inputs.CH\_Override.Value = true;  
doesn’t seem to work, I seem to be missing something…

---

<div class="post-metadata">

**Author:** ![ckrusen](https://www.epiusers.help/user_avatar/www.epiusers.help/ckrusen/32/50584_2.png) [@ckrusen](https://www.epiusers.help/u/ckrusen)\
**Post date:** [February 19, 2020, 9:43pm UTC](https://www.epiusers.help/t/how-to-get-a-combo-box-to-trigger-another-combo-box/64676/5 "2020-02-19T21:43:13Z")

</div>

Dropdowns can be dynamic, with multiple sources. And you setup rules for which source to use. That checkbox could be use in the selection of which “source”

---

<div class="post-metadata">

**Author:** ![TomAlexander](https://www.epiusers.help/user_avatar/www.epiusers.help/tomalexander/32/98890_2.png) [@TomAlexander](https://www.epiusers.help/u/TomAlexander)\
**Post date:** [February 19, 2020, 9:58pm UTC](https://www.epiusers.help/t/how-to-get-a-combo-box-to-trigger-another-combo-box/64676/6 "2020-02-19T21:58:57Z")

</div>

Most of coding in Configurator isn’t about being a c# syntax wizard, it’s about knowing _where_ to put your code. Also, there are always many, many different ways of doing the same thing.

What Mark said seems like your easiest option; I’ve done similar things several times. Put code on the “On Field Changed” action of the checkbox to set the visible or enable/disable property of your ComboBox and TextBox appropriately. Always make sure to code for all user scenarios (checking and unchecking the box in this case). People, myself included, often think the user will follow a linear path through their Configurators and they forget to code for when users change their mind on an input or go back a page, etc.

---

<div class="post-metadata">

**Author:** ![rbomford](https://www.epiusers.help/letter_avatar_proxy/v4/letter/r/90db22/32.png) [@rbomford](https://www.epiusers.help/u/rbomford)\
**Post date:** [February 19, 2020, 10:03pm UTC](https://www.epiusers.help/t/how-to-get-a-combo-box-to-trigger-another-combo-box/64676/7 "2020-02-19T22:03:28Z")

</div>

Hi Paul,

You would need to add a textbox to manually enter the part num, and then toggle the read only via the checkbox. Ideally, if the user selects a value via the combobox you would then auto-populate the textbox with the value, that way you  
can just pass the textbox to record creation as the input string, or the method rule if the part num is job mtl.

---

<div class="post-metadata">

**Author:** ![dr\_wogz](https://www.epiusers.help/letter_avatar_proxy/v4/letter/d/b2d939/32.png) [@dr\_wogz](https://www.epiusers.help/u/dr_wogz)\
**Post date:** [February 20, 2020, 2:18pm UTC](https://www.epiusers.help/t/how-to-get-a-combo-box-to-trigger-another-combo-box/64676/8 "2020-02-20T14:18:30Z")

</div>

OK, this is what I’m missing then:

I have:  
a check box: CB\_Override  
A character box: CH\_Jet  
A character box: CH\_Jet\_Override

I want the character box CH\_Jet to either accept the entry in CH\_Jet\_Override or set it to 4

I have the following code in ‘on field validate’ of CH\_Jet:

if (Inputs.CB\_override = true)  
{  
Inputs.CH\_Jet.Value = Inputs.Ch\_Jet\_Override.Value;  
}  
Else {Inputs.CH\_Jet.Value = (“4”)};

the syntax says I have 2 errors, both missing a ; … where do these go? what am I missing?

---

<div class="post-metadata">

**Author:** ![Mark\_Wonsil](https://www.epiusers.help/user_avatar/www.epiusers.help/mark_wonsil/32/51594_2.png) [@Mark\_Wonsil](https://www.epiusers.help/u/Mark_Wonsil)\
**Post date:** [February 20, 2020, 3:27pm UTC](https://www.epiusers.help/t/how-to-get-a-combo-box-to-trigger-another-combo-box/64676/9 "2020-02-20T15:27:24Z")

</div>

I don’t have Configurator access now but go to your Configurator Designer screen, click on your CB\_Override field and post a screen shot being sure to include the properties panel on the right-hand side.

---

<div class="post-metadata">

**Author:** ![danbedwards](https://www.epiusers.help/letter_avatar_proxy/v4/letter/d/9f8e36/32.png) [@danbedwards](https://www.epiusers.help/u/danbedwards)\
**Post date:** [February 20, 2020, 3:38pm UTC](https://www.epiusers.help/t/how-to-get-a-combo-box-to-trigger-another-combo-box/64676/10 "2020-02-20T15:38:39Z")

</div>

```cs
if (Inputs.CB_override.Value == true)
{
	Inputs.CH_Jet.Value = Inputs.Ch_Jet_Override.Value;
}
else 
{
	Inputs.CH_Jet.Value = "4";
}
```

---

<div class="post-metadata">

**Author:** ![dr\_wogz](https://www.epiusers.help/letter_avatar_proxy/v4/letter/d/b2d939/32.png) [@dr\_wogz](https://www.epiusers.help/u/dr_wogz)\
**Post date:** [February 20, 2020, 3:53pm UTC](https://www.epiusers.help/t/how-to-get-a-combo-box-to-trigger-another-combo-box/64676/11 "2020-02-20T15:53:28Z")

</div>

OK, managed to get the If/then statement to run:

if (Inputs.CB\_override.Value = true)  
{  
Inputs.CH\_Jet.Value = Inputs.CB\_Jet\_Override.Value;  
}  
else  
{  
Inputs.CH\_Jet.Value = “4”;  
}

this is in the ‘On Field changed’ action (I tried in it the ‘On field validating’ , and it crashes Epicor!)

now, while it does allow me to enter the string from CB\_Override.Value, it will only grab it when I hit the check box. But the check box doesn’t turn on or off, it only seems to dump the value of CB\_Override into CH\_Jet.

I feel I ether am missing something to revert back, or the if/then statement is missing something to continuously check if CB\_Override is true or false… I kinda feel there needs to be a ‘page refresh’ in the on field validating of both the CB\_Override & CB\_Jet\_Override. But am baffled how ask for this…

 ![epior help1](https://epiusers.help/uploads/default/original/3X/3/8/388a849ddde3182b66f442f028723f3146350cbf.jpeg)

---

<div class="post-metadata">

**Author:** ![dr\_wogz](https://www.epiusers.help/letter_avatar_proxy/v4/letter/d/b2d939/32.png) [@dr\_wogz](https://www.epiusers.help/u/dr_wogz)\
**Post date:** [February 20, 2020, 3:56pm UTC](https://www.epiusers.help/t/how-to-get-a-combo-box-to-trigger-another-combo-box/64676/12 "2020-02-20T15:56:42Z")

</div>

I get the following error with this line of coding:

The following errors were found during compile:

CS1061 - c:\Users\pshepherdson\AppData\Local\Temp\7\ConfigDump\Client\_paul\_testInputEventCollection.cs (60,31) - ‘Erp.UI.Cfg.TEST92e046bb88a74b178287d9e42914de43.\_paul\_testInputControlCollection’ does not contain a definition for ‘Ch\_Jet\_Override’ and no extension method ‘Ch\_Jet\_Override’ accepting a first argument of type ‘Erp.UI.Cfg.TEST92e046bb88a74b178287d9e42914de43.\_paul\_testInputControlCollection’ could be found (are you missing a using directive or an assembly reference?)  
Total number of Errors: 1, Warnings 0

---

<div class="post-metadata">

**Author:** ![danbedwards](https://www.epiusers.help/letter_avatar_proxy/v4/letter/d/9f8e36/32.png) [@danbedwards](https://www.epiusers.help/u/danbedwards)\
**Post date:** [February 20, 2020, 4:00pm UTC](https://www.epiusers.help/t/how-to-get-a-combo-box-to-trigger-another-combo-box/64676/13 "2020-02-20T16:00:05Z")

</div>

> [@danbedwards](#):
>
> Inputs.Ch\_Jet\_Override.Value;

change to  
Inputs.C **H** \_Jet\_Override.Value;

---

<div class="post-metadata">

**Author:** ![dr\_wogz](https://www.epiusers.help/letter_avatar_proxy/v4/letter/d/b2d939/32.png) [@dr\_wogz](https://www.epiusers.help/u/dr_wogz)\
**Post date:** [February 20, 2020, 4:07pm UTC](https://www.epiusers.help/t/how-to-get-a-combo-box-to-trigger-another-combo-box/64676/14 "2020-02-20T16:07:55Z")

</div>

if (Inputs.CB\_override.Value == true)  
{  
Inputs.CH\_Jet.Value = Inputs.CH\_Jet\_Override.Value;  
}  
else  
{  
Inputs.CH\_Jet.Value = (“4”);  
}

still getting:

The following errors were found during compile:

CS1061 - c:\Users\pshepherdson\AppData\Local\Temp\7\ConfigDump\Client\_paul\_testInputEventCollection.cs (60,31) - ‘Erp.UI.Cfg.TEST8d38ba89d1ee4d4582cea2c8cf039f14.\_paul\_testInputControlCollection’ does not contain a definition for ‘CH\_Jet\_Override’ and no extension method ‘CH\_Jet\_Override’ accepting a first argument of type ‘Erp.UI.Cfg.TEST8d38ba89d1ee4d4582cea2c8cf039f14.\_paul\_testInputControlCollection’ could be found (are you missing a using directive or an assembly reference?)  
Total number of Errors: 1, Warnings 0

---

<div class="post-metadata">

**Author:** ![danbedwards](https://www.epiusers.help/letter_avatar_proxy/v4/letter/d/9f8e36/32.png) [@danbedwards](https://www.epiusers.help/u/danbedwards)\
**Post date:** [February 20, 2020, 4:37pm UTC](https://www.epiusers.help/t/how-to-get-a-combo-box-to-trigger-another-combo-box/64676/15 "2020-02-20T16:37:19Z")

</div>

Did you select your Input names from the list vs. typing?

---

<div class="post-metadata">

**Author:** ![dr\_wogz](https://www.epiusers.help/letter_avatar_proxy/v4/letter/d/b2d939/32.png) [@dr\_wogz](https://www.epiusers.help/u/dr_wogz)\
**Post date:** [February 20, 2020, 4:58pm UTC](https://www.epiusers.help/t/how-to-get-a-combo-box-to-trigger-another-combo-box/64676/16 "2020-02-20T16:58:09Z")

</div>

I initially typed them in.

But i do use the list at the top “Available selections” to populate it.

I find it difficult as one screen allows you to type anything, while the expression builder seems to be missing steps & functions… so, I’m kinda bouncing between them… trying to figure out how to write an expression in one, and get the same results in the other…

---

<div class="post-metadata">

**Author:** ![dr\_wogz](https://www.epiusers.help/letter_avatar_proxy/v4/letter/d/b2d939/32.png) [@dr\_wogz](https://www.epiusers.help/u/dr_wogz)\
**Post date:** [February 20, 2020, 5:00pm UTC](https://www.epiusers.help/t/how-to-get-a-combo-box-to-trigger-another-combo-box/64676/17 "2020-02-20T17:00:08Z")

</div>

if (Inputs.CB\_override.Value == true)  
{  
Inputs.CH\_Jet.Value = Inputs.CB\_Jet\_Override.Value;  
}  
else  
{  
Inputs.CH\_Jet.Value = (“4”);  
}

OK, now I’m, not getting any error rmessage… weird.

---

<div class="post-metadata">

**Author:** ![Mark\_Wonsil](https://www.epiusers.help/user_avatar/www.epiusers.help/mark_wonsil/32/51594_2.png) [@Mark\_Wonsil](https://www.epiusers.help/u/Mark_Wonsil)\
**Post date:** [February 20, 2020, 9:27pm UTC](https://www.epiusers.help/t/how-to-get-a-combo-box-to-trigger-another-combo-box/64676/18 "2020-02-20T21:27:51Z")

</div>

So as you have seen/heard, Configurator logic is event-based. So you need to think about the state of the controls as the user clicks around the screen. In order to control the first pass through a configurator, I’ll set all the inputs except the first to Read-Only. This allows me to alter the controls as inputs are filled. You still have to be careful to reset fields if dependent inputs are changed. In this case, you Read-Only expression for the CB\_Jet\_Override is !BC\_override (not the value of the override input). So when the user makes override True, the Read-Only expression is false and a user can fill the field. You can even hide the field in the On Field Change event.

So start thinking of events and not linear programming. If you’re using an expression multiple times, put it into a User Define Method and call it in the expression.

Hope this hints get you going. It’s a bit of a curve but after a bit, you’ll get it.

Mark W.

---

<div class="post-metadata">

**Author:** ![dr\_wogz](https://www.epiusers.help/letter_avatar_proxy/v4/letter/d/b2d939/32.png) [@dr\_wogz](https://www.epiusers.help/u/dr_wogz)\
**Post date:** [February 21, 2020, 4:11pm UTC](https://www.epiusers.help/t/how-to-get-a-combo-box-to-trigger-another-combo-box/64676/19 "2020-02-21T16:11:17Z")

</div>

Thanks Mark,

the ‘resetting of fields’ still eludes me, as in how to get them to reset…

Yeah, forgot about the 'read only expression. will need to read up on that one…

this seems to do the trick:

CO\_GasType:

List Items:  
NAT Natural Gas  
PRO Propane Gas 100%

On Field Validating:  
{  
switch (Inputs.CO\_GasType.Value)  
{  
case “NAT”: Inputs.CH\_JetInstalled.Value = Inputs.CH\_NatJet.Value; break;  
case “PRO”: Inputs.CH\_JetInstalled.Value = Inputs.CH\_ProJet.Value; break;  
};  
Inputs.CO\_Elevation.Value = “”;  
Inputs.CH\_JetInstalledPN.Value = PCLookUp.DataLookup(“GAS\_JET\_PART\_NUMBER”, “Hardt Part Number”, Inputs.CH\_JetInstalled.Value);  
Inputs.CH\_JetSpare.Value = “”;  
Inputs.CH\_JetSparePN.Value = “”;

CO\_Elevation:

List Items:  
1000 0 - 1999 feet above sea level  
2000 2000 - 2999 feet above sea level  
3000 3000 - 3999 feet above sea level  
4000 4000 - 4999 feet above sea level  
5000 5000 - 5999 feet above sea level  
6000 6000 - 6999 feet above sea level  
7000 7000 - 7999 feet above sea level  
8000 8000 - 8999 feet above sea level  
9000 9000 - 9999 feet above sea level  
10000 10000 - 10999 feet above sea level

On field validating:  
Inputs.CH\_JetSpare.Value = PCLookUp.DataLookup(“GAS\_JET\_HIGH\_ALTITUDE”, Inputs.CO\_Elevation.Value, Inputs.CH\_JetInstalled.Value);  
Inputs.CH\_JetSparePN.Value = PCLookUp.DataLookup(“GAS\_JET\_PART\_NUMBER”, “Hardt Part Number”, Inputs.CH\_JetSpare.Value);  
switch (Inputs.CO\_Elevation.Value)  
{  
case “1000”: Inputs.CH\_JetSpare.Value = “Not Required”; Inputs.CH\_JetSparePN.Value = “Not Required”; break;  
};

CB\_Override

On Field Changed:  
if (Inputs.CB\_Override.Value == true)  
{  
Inputs.CH\_JetInstalled.Value = Inputs.CH\_Override\_Jet\_Install.Value;  
Inputs.CH\_JetSpare.Value = Inputs.CH\_Override\_Jet\_Spare.Value;  
Inputs.CH\_Override\_Jet\_Install.Invisible = false;  
Inputs.CH\_Override\_Jet\_Spare.Invisible = false;  
}  
else  
{  
Inputs.CH\_Override\_Jet\_Install.Invisible = true;  
Inputs.CH\_Override\_Jet\_Spare.Invisible = true;  
Inputs.CO\_Elevation.Value = “”;  
Inputs.CO\_GasType.Value = “”;

But sadly, while I seemed to have solved this, a new problem has arisen… ☹ completely unrelated…

---

<div class="post-metadata">

**Author:** ![Mark\_Wonsil](https://www.epiusers.help/user_avatar/www.epiusers.help/mark_wonsil/32/51594_2.png) [@Mark\_Wonsil](https://www.epiusers.help/u/Mark_Wonsil)\
**Post date:** [February 21, 2020, 4:22pm UTC](https://www.epiusers.help/t/how-to-get-a-combo-box-to-trigger-another-combo-box/64676/20 "2020-02-21T16:22:02Z")

</div>

> [@dr\_wogz](#):
>
> But sadly, while I seemed to have solved this, a new problem has arisen… ☹ completely unrelated…

As with any solution, start simple and build in small steps so you know where things break. You got this.

[Next page](https://www.epiusers.help/t/how-to-get-a-combo-box-to-trigger-another-combo-box/64676.md?page=2)
