Combo Box Dropdown Parameters change based on another combo box dropdown selection using user codes

Hello! I had a question about combo boxes.

What I am trying to do is I have a combo box and in its dropdown, I click a selection, and a separate combo box’s dropdown fields change respective to whatever was selected on the previous combo box.

I am using UserCodes.UserCodesCombo and am confused on how I would change user codes during the process? I am using FiltersParam CodeTypeParam=(user code) to give the dropdowns data. I have multiple UD Codes containing the data that should be listed in the second combo box dropdown, each UD code number respective to an option to be selected in the first combo box.

Is there a way to set user codes to change after each selection? Does this require an event? I haven’t seen any event action that would handle changing UD Codes. Maybe combo refill could be used?

You will need to set some variables in TransView and do your filters on that.

Oh ok I haven’t used TransView much but I’ll check that out, thanks!

Typically, I would use the first combobox to select the UserCodeType… then the second box is used to choose the UserCode.

Is that what you’re doing?

Right now, I have both dropdowns using the UserCodes.UserCodesCombo schema under Reusable combo with the only difference being in Filters Param I have CodeTypeParam = a UD code. They both display data well, but the second combo box needs to change the UD code it is being given respective to the UD code it is being told to display. I had that data filled into the second combo box as a place holder as I know something needs to change.

Apologies but I am a little confused by what you said. The first combo box selects the UserCodeType, then the second box chooses the UserCode? As I wrote that, I think I understood it more. To write the logic down, UserCodeType is selected from the first drop down that designates another specific UD Code. That UD Code then fills it’s parameters into the TransView, then the data in the TransView gets sent to the second combo box through a refresh event? So maybe I delete the UserCodesCombo in the second dropdown and have it list the data given to the TransView? Or maybe it is possible to skip the TranView by giving the second combo box a filter parameter with a variable that can be changed through an event?

Is the first combobox supposed to be the filter for the second?

Yes

So, both comboboxes need to be bound to the same dataview.

If your first combo is bound to: MyDataView.Combobox1
Your second box is bound to: MyDataView.Combobox2

The Filters Params for your second combobox will be CodeTypeParam = ?[Combobox1]

But, like I said the “default” set-up is trying to filter the CodeTypeID

image

and then the combo should display the User Codes underneath that Code Type.

I currently have both combo boxes EpiBinding linked to their DataViews. They use UD08.UD08_ShortChar07 and 08, respectively.

If I were to change the second combo box filter to CodeTypeParam = ?[Combobox1], how does it know what UD Code to use? Each option under combo box 1 relates to a different UD code, would there be somewhere I can specify / connect each piece of data from ComboBox1 to a UD code?

With those bindings, your second combobox would have: CodeTypeParam = ?[ShortChar07]

The feeds the value of ShortChar07 into your second combobox’s filter.

BUT… again, this is based on the “default” UserCodeCombo setup. I need to better understand your UD Codes/Structure. Can you provide an example of your codes so we can better understand what you’re looking to do?

Apologies, I’m still a little uncertain.

No worries. Here’s the codes I will be using:


150 is what is within Combo Box 1.

151-158 contain the values that will appear respective to whatever is chosen from 150.

Within 150…

and within all the other codes, their Code ID is 01, 02, 03, so on.

Are you able to restructure a bit? Not sure how far you’ve used these user codes.

I would set them up like the below:

So you have 150… it is a master list of defect code TYPES.

The user will select one of those (DESIGN in this example).

“DESIGN” becomes the value of ShortChar07

Your second combobox would have a FilterParams of CodeTypeParam = ?[ShortChar07]

Your second combobox should then only show the 01,02,03 “codes” which are under the “DESIGN” code type.

Here’s another example showing my set-up for this type of thing…

I have a “master” CodeType called DWG_SOURCE. These are sources of where my company may receive drawings… from customers, manufacturers, OEMs, Suppliers, etc.

So, my UD Codes under that DWG_Source CodeType are simply: C, I, M, N, O, etc.

I then create CodeTypeIDs for each of those. So I have a CodeTYPE of Just “M” for manufacturers. In there, I have individual codes for each manufacturer we’ve ever received a drawing from:

So… in my example/set-up… my user in the first combo box would see a list of:

Customer
Industry Standards
Manufacturers
NFM
OEMs
etc.

They would choose Manufacturers (CodeTypeID = ‘M’).

The second combobox would then only show UserCodes where CodeTypeID = ‘M’

Does that make sense at all? Not sure if I’m explaining it well.

Along those same lines… you COULD just redo your Codes inside your 150. The key is whatever you have INSIDE 150, need to be defined as CodeTypeIDs themselves so you can expand down another layer:

Ahhhh okay. That does make sense! Previous Epicor-ist created these codes 5 years ago, so I will have to confirm that restructuring won’t hurt.

But yes, this absolutely makes sense. Thank you for explaining in depth. I’ll see what I can do in Pilot and let you know how it went.

I will probably go the latter route you mentioned, changing the codes within 150, I think that would be the better option to test first.

Yeah, I would be careful. If they’ve been around that long, I’d have to assume they’re being used somewhere.

BUT… you could create a new “150”… call it “150_01” or something. That way if the original “150” is being used somewhere, you’re not corrupting that.

Your new “150_01” would then just be a fresh map to connect “COMP” to 151. “DESIGN” to 152, etc.

Even better. I like that idea, in case 150 is used elsewhere. and 150_01 will contain the new codes that relate to the existing codes. Thanks!