4D v14.3

OBJECT SET DATA SOURCE

Home

 
4D v14.3
OBJECT SET DATA SOURCE

OBJECT SET DATA SOURCE 


 

OBJECT SET DATA SOURCE ( {* ;} object ; dataSource ) 
Parameter Type   Description
Operator in If specified, object is an object name (string) If omitted, object is a field or variable
object  Form object in Object name (if * is specified) or
Field or variable (if * is omitted)
dataSource  Pointer in Pointer to new data source for object

The OBJECT SET DATA SOURCE command modifies the data source of the object(s) designated by the object and * parameters.

Passing the optional * parameter indicates that the object parameter is an object name (string). If you do not pass this parameter, it indicates that the object parameter is a field or variable. In this case, you pass a field or variable reference instead of a string (field or variable object only).

The data source is the field or variable whose value is represented by the object when the form is executed. In Design mode, the data source is defined in the Property list, usually through the Source and Source Field (fields) or Variable Name (variables) row:

Except for list boxes (see below), all data sources of the form can be modified by this command. It is up to the developer to ensure the consistency of the changes made. 

In the case of list boxes, the following points must be considered:

  • Data source modifications must take the list box type into account: for example, it is not possible to use a field as the data source for a column in an array type list box.
  • For selection type list boxes, it is not possible to modify or read the data source of the list box object itself: in this case, it is an internal reference and not a data source.
  • This command is mainly used in the context of array type list boxes. For selection type list boxes, you can use the LISTBOX SET COLUMN FORMULA command instead.

If this command is applied to a data source that is not modifiable, it does nothing.

Example  

Modification of the data source for an entry area:

 C_POINTER($ptrField)
 $ptrField:=Field(3;2)
 OBJECT SET DATA SOURCE(*;"Input";$ptrField)

 
PROPERTIES 

Product: 4D
Theme: Objects (Forms)
Number: 1264

 
HISTORY 

New
Created: 4D v14

 
SEE ALSO 

OBJECT Get data source

 
ARTICLE USAGE

4D Language Reference ( 4D v14 R3)
4D Language Reference ( 4D v14 R2)
4D Language Reference ( 4D v14.3)
4D Language Reference ( 4D v14 R4)