Default data file management in merged applications (stand-alone and client-server merged applications) has been modified in 4D v15:
- Developers are now able to define a "default data file" at the application building stage.
- When no data file is found, if a "default data file" is detected, it is automatically opened silently in read-only mode by 4D.
These new features give developers better control over data file creation and/or opening when launching a merged application for the first time. More specifically, the following cases are covered:
- Avoiding the display of the 4D "Open Data File" dialog box when launching a new or updated merged application. You can detect, for example in the On Startup database method, that the default data file has been opened and thus execute your own code and/or dialogs to create or select a local data file.
- Allowing the distribution of merged applications with read-only data (for demo applications, for instance).
4D v15 now offers a simple way to embed a default data file into a merged application, so that the application can be installed or updated on end-user machines without using an additional dialog box. To define a default data file:
The following graphic illustrates this new feature:

When the default data file is detected at first launch, it is silently opened in read-only mode, thus allowing you to execute any custom operations that do not modify the data file itself.
When launching a merged application for the first time, 4D tries to select a valid data file. In previous releases, if no default data file (same name and same level as the .4dc file) was provided, a standard "Open data file" dialog box was displayed (prompting the user to create the data file in the Application folder).
In 4D v15, a new step has been added to the opening sequence, allowing developers to take advantage of the new default data folder feature (see above). In step 2, the application is now opened without using any standard "Open data file" dialog box and developers can execute suitable custom code.
The new opening sequence for launching a merged application is:
- 4D tries to open the last data file opened.
- If not found, 4D tries to open the data file in a default data folder next to the .4DC file in read-only mode (new in 4D v15).
- If not found, 4D tries to open the default data file next to the structure file with the same name.
- If not found, 4D displays the standard "Open data file" dialog box.