Right now, I’m in the process of trying to create my own version of the Case Entries “Topic Tree” function and I’m having difficulty with one of the steps. To clarify before I get into what I’ve done so far, what I’m trying to accomplish is a group of linked combo boxes that will have options available in them depending on what the value of the previous combo box is. For this project, I have two separate UD tables I’m using. The first one has all of the values I want available along with a description and the ID value of the parent that’s used as the link between combo boxes. I’ve managed to link them at the moment by using a “Simple Search” along with a criteria line of code making sure that the available options has an ID that matches the current combo boxes values parent ID.
What problem I’m running into now is trying to account for changed combo box values that should result in all combo boxes lower in the tree with a null value. I tried to change the text values of the combo boxes to “”, but then they would fill in with a UD table value once I clicked in the box (I’m assuming this has something to do with me not removing all of the data in the combo boxes, and it reverting back to it). Anyone have thoughts on how to accomplish what I’m attempting to do in terms of code I’m missing or maybe an entirely different easier way of going about this?
Are they bound to an EpiDataView? if so you can simply use the Filter function of the combo to automatically filter on the “related” DataView field and you get this functionality for “FREE” (is recording is for E10 but it works the same in E9)
Here is the Format example for the filter
CustNum = ‘?[Number01,0]’
That seems to be a lot closer to what I’m looking for, but I’m running into the problem where my Key2 = ‘?[ShortChar01,0]’ filter is returning an error stating:
Invalid query: where Company = ‘company123’ and ((Key2 = ‘1’)).
I’m assuming the problem lies with the end part of my filter query not formatting the value in the right data type. Do you have any idea on where to go from here, I tried some basic conversion syntax to attempt converting the value to a string, but it doesn’t seem to be doing what I’m looking for.
Note: A filter like the following does seem work fine though: Key2 = “1”
Right instead of 0 use "
PartNum = ‘?[PartNum,”]’
Looks like I’m still getting the same error. Although I’m now getting this error as well as soon as I create a new record:
Invalid query: where Company = ‘SC95564’ and ((Key2 = ‘""’)).
Note: I tried the filter with one quotation mark and also two in the previously mentioned location since I wasn’t sure if one way would work over the other.
Two single quotes works for me
PartNum = ‘?[PartNum,’’]’
Still not working for me unfortunately. But, I found changing the field referenced in my filter from Key1 to Number01 and changing the filter text to the following did the trick:
Number02 = ?[Number01]
I’m assuming the reason why your solution didn’t work for me has something to do with the formatting of the Key field. I’ll mark it as a solution though since I’m sure it most likely is the correct path to take for other users/situations! As for now, I’ll probably have to create some kind of Method Directive or C# Form Customization code that will clear all text fields that are lower in the epiComboBox than the one changed at a particular moment in time. Thanks for all the help as well, I really appreciate it!
@kalbee for my own curiosity could you give me an example of your two UD Tables layout? I am not sure why it is not working and it’s going to bother me till the end of time. If you give me the layout of 2 records I’ll replicate in my system and try to figure it out.
Sure, no problem haha. Tell me if you need any more information beyond this!
(One tab for each UD table)
Epicor Example Data.xlsx (12.1 KB)
(Two number fields are utilized since they seem to work with my filter formulas while referencing the Key fields gave me the errors mentioned above.)
*Following fields are all epiCombo’s that use the filters and have a EpiBOName of UD22 they reference.
ShortChar01 = DisplayMember = Character01 // ValueMember
ShortChar02 = DisplayMember = Character01 // ValueMember