Configurator combo box adding row after data is loaded

I am working in configurator app studio, which is slightly different to normal app studio. I need to add a generic entry to my drop down list on several combo boxes in a configurator. Basically, there would be an “Other” option at the bottom that when selected would perform some logic on the column changed event.

In windows forms .net there’s an .Add() function on combo boxes or I could just tack the entry to the end of a list I use as a datasource. I do not see any such function on configurator combos in a c# widget, and I am linking my BAQ directly to my combo through a dynamic list, no dataview. What is the simplest way I can achieve this?

In all my training it seems like configurator generally didn’t use dataviews for this sort of data. Otherwise, I would just add a row-add. Maybe a user code with the Other value hardcoded and just do a sql union? I hate that though.

Use a user defined method to populate your drop down. You then have complete control over what data gets past back to combo. You can do multiple queries and custom logic to build your list of values. From your example you could add ‘Other’ to the values you get back from your query.

Also my understanding is BAQs can be less efficient as any dynamic filtering takes place on the client side.with the whole dataset passed over and filtering then takes place.

Our consultant hadn’t shown us user defined methods at all. I’ll check this out, thanks.

Once you start using them good likelihood you won’t use BAQs anymore. For most configurators I only use one table (Configurator Control Data PCConData) to store all my lookup values so I only need one UD method. PCConData has 9 keys so it has a ton of flexibility vs the standard UD tables that only have 5 keys.

Probably true I’m finding BAQs very limiting in this context

You can build BAQs with parameters for configurators, so filtering performance isn’t really an issue.

The one reason why you might want to stick with BAQs to populate combo inputs is that it appears BAQs is the only way to get a separate value and description field for each entry, apart from dynamic lists with the data directly in the configurator… You can’t do it with lookup tables, I don’t think you can do it with methods either, not 100% sure though.

Any time I reference lookup tables I am referring to user Defined and other regulars Epicor tables.

Lookup tables vs User Defined tables are different beasts. I never use Lookup Tables because they are so limited in working with them. They are easy to understand but anything beyond simple relationships are difficult. You can build complex LINQ queries to get around it but I don’t see the value.

User Defined tables or PCCOnData or any Epicor tables are easily queried and can support complex relationships via a User defined method.

With user defined methods you can send back a value and a display member just as with BAQs. User Defined methods also allow you to build up a list of values from multiple sources and custom logic.

While BAQs can be filtered by the configurator the filtering happens on the client side if not done as permanent filtering on the BAQ side. I will occasionally use a BAQ for a simple list lookup but User Defined Methods are so much more flexible. Usually a single User Defined method can handle many different combo boxes by passing different flags and values for the method to modify its behavior.

Would it be possible for you to share a screenshot of how you do most of your querying in ud methods? I have seen how you can return a string with certain delimiters from a UD method to a combobox to separate the value and display but not sure how I could do this without writing a function to construct the string. Do you do this a different way?
image

I pass in via parameters to the UD method the filtering criteria, how I want things sorted and what fields to pass back as my ValueMember and Display member.

StringBuilder MyList = new StringBuilder ();

// build whatever query you need and then loop through it
var query = (from r in Db.PcConData where r.Company == Context.CompanyID &&
r.PartNum == PartNum &&
r.TypeCode == TypeCode select r);
// more filtering and sorting goes on …

foreach (var line in query)
{
String test = line[valueMember] + "" + line[DisplayMember] + "~"; // value member is separated from display member by backtick character and each set by the ~ tilde
MyList.Append(test);
}
// at this point I could add some custom values that didn’t come from the query.

return ((MyList.ToString ()).Length > 0) ? (MyList.ToString ()).Substring (0, (MyList.ToString ()).Length - 1) : (“N`None”); // if the query resulted in nothing we return N, None