AnsweredAssumed Answered

Segmented drop down list

Question asked by Guy Edkins on Nov 10, 2019

All,

 

I have been working on XML based documents of late. As part of this effort I ran into an interesting issue while developing a segmented list in a drop down; based on the first character. Problem is we have a large number of customers in our ERP system and I wanted a way to narrow the list based on the first character of the name. Easy enough to do by mapping a list for cards via SQL with the following code:

SELECT [customername] FROM [Customers].[dbo].[Customers] where customername LIKE '[A-F]%' order by customername.

Which gets me a nice sorted listing of the A thru F customers. I have four lists each calling the next segment of the alphabet. Makes for faster user selection since the presented list is ~1/4 the total number of customer names.

 

I have four drop down downs on the template card, each one connected to a different list. The drop downs are all sitting on top of one another and visibility is controlled by a set of four radio buttons above the drop down with control logic hiding the appropriate drop down upon radio button selection. See below.  

 

 

All works perfectly to this point.  Here is the problem I ran into. The last control placed on the card wins the passing of the value because all of the drop downs are mapped to the same variable. The result; you almost never get a value being passed out on execution unless you pick from the last placed drop down. If SW could add a touch of code that parsed the linked controls returned value and tested for null it could be fixed in a flash. The segmented list was a nice idea (I think anyway), but foiled again. We need more logic to manage controls on data cards SolidWorks! We could also use internal template logic too!

Outcomes