Log In    |    Knowledge Base    |    4D Home
Tech Tip: Managing Dynamic Lists
Published On: September 7, 2018
Your current browser may not allow you to download the asset. We recommend Mozilla Firefox or Google Chrome.
Log In

There are many scenarios which call for lists to be dynamicly generated or updated for specific uses. When working with lists, one of the first thoughts are to use 4D's integrated list editor however this feature is intended to be used to maintain a set of static lists that should not need frequent additions or modifications. In fact, there is not an ability to programatically delete lists from the list editor.

If the list editor is used in such a fashion it can lead to issues down the line due to how they work. The lists are handled similar to the "Resources" folder in which each client contains a full local copy of all of the lists and the contents. This is fine in most cases of static usage of the lists, but when a list is modified or a new list is created the client pushes the entire set of lists including the updates to the server and then the server sends the set of lists to the clients. During this timeframe if another client happens to update or add another list before it recieves the update it will send another incomplete set of lists to the server which can get pushed out to all of the clients and cause issues.

This can be caused by a number of factors such as:

  • Large number and size of lists
  • Network issues
  • Large number of clients
  • High frequency of list modifications

A better way to handle these type of lists are to create them dynamically. If the lists need to be stored for future uses then consider creating a table for the lists. This will allow the lists to live on the Server and will not require the Clients to keep a local copy of all of the lists. An object type field can contain the list along with additional information regarding the list in the same field or in separate fields for the record. When a client does need to use a list it can just query and load the individual record for the list then dynamically build the list during runtime.