KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Default data file for merged applications
PRODUCT: 4D | VERSION: 15 | PLATFORM: Mac & Win
Published On: August 14, 2015

In 4D v15, a new feature has been added to allow developers to define the “default data file” in merged applications (stand-alone and client-server merged applications) at the application building stage. This means that end users of the built merged applications will no longer be presented with the open data file dialog when they open the application for the first time.

Open Data File dialog


Below is a brief overview of how this new feature is implemented. Within the folder containing the interpreted structure, a folder called “Default Data” is created. Within this folder the default data file (Default.4DD) is created along with other necessary files (journal file, index file, etc.) Once those files are created, and the application is built. The built application will contain the files specified in the “Default Data” folder.


Step by Step Example:

1.) In the same folder the database (.4DB) exists, create a new folder called “Default Data”. Note that the folder must be named “Default Data”.


2.) While holding the alt key down, open the database (.4DB) in 4D v15. The following dialog should come up asking to create or select a data file. Choose to Create a new data file.


3.) Select the location to be the “Default Data” folder.
4.) Name the new data file “Default.4DD” and save the file.


5.) The new data file should be created in the “Default Data” folder. Other corresponding files, including the journal file should be automatically created.


6.) Build the application.


The resulting built application should use “Default.4DD” as the data file. When opened, no Open Data File dialog should come up. Instead, the default data file will be used. The default data file is located in Application Folder->Database->Default Data.


Note:
The default data file is opened in read only mode, meaning no data can be added, modified, or deleted. However, the feature does allow the developer to execute custom operations that do not modify the data file itself. A custom operation could include OPEN DATA FILE to open a different data file in read/write mode.

For more information about this feature, refer to the documentation on default data file in merged applications:
http://docs.4d.com/4Dv15/4D/15/Default-data-file-in-merged-applications.300-2018649.en.html