The DefaultDataSource placeholder

Previous Next

Each page has a default data source. This is the data source object that has its Default Data Source property set to Yes.

The DefaultDataSource placeholder refers to the current page's default data source.

Syntax

${DefaultDataSource}

 

This placeholder allows you to re-use controls and routines in multiple pages without the need to hard-code a different data source name each time.

Example

In the Controls catalog, you will find a DeleteButtonControl for which the onclick action has the following settings:

Action Name: DeleteRecord

Data Source Name: ${DefaultDataSource}

 

These settings are equivalent to the following code snippet:

DeleteRecord(${DefaultDataSource}

 

At runtime, when the button is pressed, the ${DefaultDataSource} placeholder is substituted by the name of the data source in the page that has Default Data Source = Yes. The result is that the current record is deleted from the recordset that maps to that data source.

NOTE: Constructs with ${DefaultDataSource} are becoming obsolete. For example, DeleteRecord(${DefaultDataSouce}) is replaced by constructs using .rowDelete().

 

See Also

Scripting with Data Sources