Issue with controls loading - need advice

My first form that opens in the app is call Home. When the Home.onshow event fires I do a series of things in sequence:

  1. Initialize a SQLite database
  2. Check if there are existing records that need to be sent to the server via Api post.
  3. Execute a function called RunDataLoad to get records into the SQLite database.
  4. Execute several Api ajax post methods (async=false) to save results into SQLite tables. This app works offline as needed.
  5. Run functions that then should fill 3 Bootstrap Select controls from SQLite on the Home form.

The Select controls do not get filled the first time around on the Home.onshow event. If I run the code to fill the Select controls manually via a button after the form has load, then the controls load with data.

Am I loading to much processing on the onshow event?

Wait for DeviceReady in the Main() routine for items you only want to run once. The onShow is fired every time the form is shown. The Wait is critical. Search this board for references on how to wait for DeviceReady - their are a bunch.

Thanks Gary, I also just moved most of my initial Api calls to a splash screen with activity indication.