PA_GetFieldRelation

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

version 2003


PA_GetFieldRelation (tNum; fNum; relatedTable; relatedField)

ParameterTypeDescription
tNumshortTable number
fNumshortField number
relatedTableshort *Related table number
relatedFieldshort *Related field number

Description

If a relation begins at the Field being accessed, PA_GetFieldRelation will return the number of the related table and field in *relatedTable and *relatedField.

If there is no relations starting from the field, or if an error occurred, *relatedTable and *relatedField are set to 0.

Example

Get the name of a related field:

   void GetRelatedFieldName (short tNum, short fNum, char *name)
   {
      short rT, rF;

      name[0] = (char) 0;// initialize file name at "" (error)
      PA_GetFieldRelation(tNum, fNum, &rT, &rF);
      if( (PA_GetLastError() == eER_NoErr) && (rT != 0) && (rF != 0) )
         PA_GetFieldName(rT, rN, name);
   }

See Also

PA_GetFieldList, PA_GetFieldName, PA_GetFieldProperties.

Error Handling

Use PA_GetLastError to see if an error occurred (bad table/field numbers).


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