Before reading this section, it is recommended to get acquainted with the section dedicated to scripting.
The Link To Folder field allows the user to keep a link to any folder in the database. Let's take a closer look at this option.
- Create a new database and, using Form Editor, create the Project form with two fields: a simple text field named Project Title and the Link to Folder field named Project Folder:
- Create the Projects folder with the Project record in it. Click the Project Folder field and create a new folder; name it Project A Files in the folder selection dialog. Select this folder:
Now every time clicking the Project Folder field, you will be automatically transferred to the Project A Files folder, where you can save records on the project.
Using "Link to Folder" field in formulas
What if we want to know how many records belong to this project without looking into this folder every time? Or perhaps we need to know the total amount of expenses on this project?
In such cases use Mathematical Field.
- Open Form Editor and add a Mathematical Field named Records Count and containing the following formula:
As you see, as the folder for the formula, which returns the number of records, the value of the Project Folder field is used. Save the formula and return to the database.
- Now this form shows the number of records in the selected folder:
Using "Link to Folder" field in scripts
Now let's create a button on the form to add notes to the selected folder automatically.
- Open Form Editor and create a form named Note. It should have two simple fields - Note Title and Note Text:
- Go back to the Project form and add a button with the following script on it:
In the first line of the script we copy the value of the Project Folder field into the [$folder] variable. In the second line we create the Note record in the folder of the specified variable. Record creation occurs within a pop-up screen.
- Name this button New Note. The form should look like this:
Every time you click the button, a new record form will pop up, and a record will be created in the field set by Project Folder.
To create more complicated record relations (for example project - person responsible - notes), use relational fields.