Dynamic Dropdowns

Andy McKenna

New Member
My session has rows that looks roughly like this:

ID, ShipmentNumber, ScanDate, etc

I want to make a dropdown on the form that is populated by the unique ShipmentNumbers in the table. I won't know what they are at design time. How can I do this? I know the SQL syntax to determine it, just not how to get it in to that dropdown at the FormInitialize event.
 

James

Member
According to the post at http://forum.tracerplus.com/index.php?threads/questions-dropdowns-and-connect-filtering.103/ it's not possible inside the app now but may be in future versions.

If the information is available on a desktop, you can save the appropriate values into S##F##_auto.txt which will be automatically imported into the matching dropdown. I don't use Connect, but if you do you should also be able to sync the data that way.

If the shipment numbers are being added on the handheld and you want them available without syncing, you'll have to use a live grid and bind the column to a field control. The field change event for that field will let you trigger other displays.

For example, make a second session with a live grid that displays shipment numbers from your source session. Bind that column to a field (set the direction to ToControl) so that when you select an entry on the grid, the value of that entry populates the field. That field can be set as a filter criteria for another grid. In my experience it sometimes requires a refresh of the second grid before the right data is displayed, done by one of three methods - Tapping one of the page arrows on the grid, making a refresh button for the grid, or using a rule that runs on FieldValueChanged to refresh the grid control. I've had issues doing this with a race condition that caused me to refresh multiple times before the new data was displayed.

I suppose you could also export just the shipment number then do an import custom (I think), or exit TracerPlus to move and rename the file then start TracerPlus making it import the data to the dropdown. I'm just thinking out loud now.
 

Andy McKenna

New Member
Thanks for the ideas. In my case it was just going to be a time saver/convenience as the operator will have the shipment number available and can just type it in.
 

James

Member
I've been trying to fight my way through an increasingly complex series of live and cached grids to accomplish something similar - show destinations in one grid, items for destination based on selection in second grid, but hide in second grid once I scan the item into third grid. Without SQL there's no data integrity (destinations show up multiple times, even though they are marked as key fields and unique in table), and with SQL it creates a race condition and doesn't refresh the displays with current data. >_<

I'd be interested to know if the refresh issues could be replicated on WinCE. All of my dev is on Android and there seem to be a number of differences in behavior between the two.
 

Steve

New Member
I have a dynamic dropdown that filters out completed order lines. It seems that once the order is compete and TPC does not return any data, the drop down list still contains data from the last refresh that returned data. Is there a way to clear the drop down list before refreshing it or when TPC returns not data from a refresh.

Also, which release to you think will support drop down controls based on data stored TP client? Once that it released, I am going to scrap this link to TP connect, so if it is soon, I will just wait.
 

Joseph Kraebel

Administrator
Staff member
Hello All,

Dynamic dropdowns are definitely on our new features list however we are not quite sure when this will land. The concept we would most likely be using is grabbing data from a session itself similar to how the grid workaround James suggested works. This would also enable the drop downs to be populated/used in a Live Mode profile in TracerPlus Connect.

Andy, is there anyway you can have a separate table with just the unique shipment numbers that can be synced to this drop down? Currently we are unable to flesh out only the unique instances of a particular field and just sync those, it would ne dup syncing them all in this case. if you are unable to isolate these into another table then there may be a way to do this with SQL statements on the device along with the grid method James was referring to.
 

Steve

New Member
Personally, I would like the flexibility that would come with populating the drop down directly with a SQL statement and would like this in addition to a more user friendly option.

If you are going to change the logic behind the dropdowns it would be nice if you could accommodate multiple display values. That would allow me to display an item number and a description or an order line and its status. This would make it easier for the user to select the right option the first time.
 
Top