Configurator User Defined Method for Dynamic List

I have a combo box in my Configurator that I need to populate with materials that are in a specific part class and associated to an operation in my SuperMOM. I did this originally with a BAQ but there isn’t any way to pass parameters from Configurator so I set out to do it with a user defined method using Linq. My method is returning a string array, however, it appears that dynamic lists only accept methods that return a string.

How do I implement a user defined method that can populate a dynamic list in Configurator with an array of strings? Can this only be done via code in OnFieldChange of the combo box that drives the criteria for my materials? If so, what is the best practice for populating a combo box from a string array in C#?

Thank you in advance!

1 Like

I’ve done this in the past. It’s a bit clunky but from memory you need to use “~” as a delimiter.

ie, you should return a string that looks like “option1~option2~option3”.

Hope that helps.

Use a foreach loop to build the return string

string retVal = "";
foreach (string s in linqArray)
    {
    retVal = retVal + s + "~";
    }
return retVal;

Where linqArray is the array with the values. You might need to strip off the final ~

1 Like

Thank you both for the reply. I don’t see this documented in the Configurator Technical Reference Guide. I would have never have found it. lol

No only can you return a list of options, you can also return the Descriptions for those options… if your returned string looks like this:

"A`Answer 1~B`Answer 2~C`Answer 3"

your combo box will show the descriptive answers “Answer1”, etc, but the returned VALUE will be the answer “A”.

2 Likes

Thanks for the info. I will definitely keep that in mind.

I wasn’t aware of that, will file that one away for future use too. Thanks Tim.