Brilliant Database Software - Home
Database software - Online Help System

Online Help System

Back to Brilliant Database Web-Site | Write to Support | Help Index



Working with Folders using Scripts

table border="0" width="100%" cellspacing="0" cellpadding="4" bgcolor="#00000077">
Working with Folders using Scripts

Introduction

The present section describes how to work with folders using scripts and variables, as well how to use the Link to Folder field.

We will analyze automating of work with folders by the example of a simple storehouse database. Let’s imagine we have two types of records: products and operations (receipts and expenditures of products). For every product there is a separate folder where operations for the given product are stored:

The Products Catalog folder contains records of the Product type:

The Product form has the following fields:

  • Title - a usual text field;
  • Folder - a field of the Link to Folder type. This field contains links to folders in which operations for the given product are stored.
  • 3 buttons showing how we can use the Folder field. Let’s have a closer look at them:

Add Operation

1

[$f] = Folder ID("Product: Folder")

2

Add Record (Operation, [$f], No, Create using popup form)

The script of this button creates a record of the Operation type in the folder specified by the [$f] variable. The [$f] variable, in its turn, is set in the first string of the script from the Folder field.

View Operations

1

[$f] = Folder ID("Product: Folder")

2

Go to Folder ([$f])

The given script performs jumping to the folder set by the [$f] variable.

View Quantity

1

[$q] = folMathOp([Folder],|Operation|,|Quantity|,|Sum|) (for Product)

2

Show Message (Quantity: [$q], -)

In this script the application calculates the sum of the Quantity field for all operations stored in the folder set by the Folder field, and displays the result of work in the MessageBox window.

Summary

Therefore, you can use the value stored in the field of the Link To Folder type:

  • In queries, for specifying the folder from which records will be fetched;
  • In all actions, where you have to specify a folder (move records, create folder and so on);
  • In formulas.






All topics in the "Link To Folder Field" section: