AP Create relation

4D - Documentation   Français   English   German   4D_Pack, Command Theme List   4D_Pack, Command Alphabetical List   Back   Previous   Next

version 2004.1


AP Create relation (sourceTableNum; sourceFieldNum; destTableNum; destFieldNum) Longint

ParameterTypeDescription
sourceTableNumLongintNumber of the table from which the relation starts
sourceFieldNumLongintNumber of the field from which the relation starts
destTableNumLongintNumber of the table where the relation arrives
destFieldNumLongintNumber of the field where the relation arrives
Function resultLongintError code (0=no error)

Description

The AP Create relation command allows you to create a relation between two tables. In sourceTableNum and sourceFieldNum, pass the numbers of the source table and field, and in destTableNum and destFieldNum, pass the numbers of the destination table and field.

The relation is created with standard properties. You can use 4D relation management commands to get or set these properties.

If the operation is completed successfully, the function returns 0. Otherwise, it returns an error code.

Note: This command does not work when it is executed from a compiled application that has been merged with 4D Runtime Volume License.

Example

This example creates a relation from table 1 to table 2:

   C_LONGINT($SourceTable;$SourceField;$DestTable;$DestField)
   $SourceTable:=1
   $SourceField:=2
   $DestTable:=2
   $DestField:=2
   $error:=AP Create relation ($SourceTable;$SourceField;$DestTable;$DestField)

4D - Documentation   Français   English   German   4D_Pack, Command Theme List   4D_Pack, Command Alphabetical List   Back   Previous   Next