4D v16.3OB SET |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v16.3
OB SET
OB SET
The OB SET command creates or modifies one or more property/value pairs in the language object designated by the object parameter. object must have been defined using the C_OBJECT command or designate a 4D object field. Note: This command supports attribute definitions in 4D Write Pro objects, like the WP SET ATTRIBUTES command (see example 10). However, unlike WP SET ATTRIBUTES, OB SET does not allow you to handle a picture variable or field directly as an attribute value. In the property parameter, pass the label of the property to be created or modified. If the property already exists in object, its value is updated. If it does not exist, it is created. In the value parameter, pass the value you want to set for the property. Several data types are supported. Note that:
Creating an object and adding a text type property: C_OBJECT($Object) Creating an object and adding a Boolean type property: C_OBJECT($Object) Modifying a property: // $Object = {"FirstName":"John","LastName":"Smith"} Adding a property: // $Object = {"FirstName":"John","LastName":"Smith"} Renaming a property: C_OBJECT($Object) Using a pointer: // $Object = {"FirstName":"Paul","LastName":"Smith"} Using an object: C_OBJECT($ref_smith) You can also change a value on the fly: OB SET($ref_smith ;"name";"Smyth") If you have defined the [Rect]Desc field as an object field, you can write: CREATE RECORD([Rect]) You want to export data in JSON that contains a converted 4D date. Note that conversion occurs when the date is saved in the object, so you must call the SET DATABASE PARAMETER command before calling OB SET: C_OBJECT($o) In the method of a form containing a 4D Write Pro area, you can write: If(Form event=On Validate) You can also read custom attributes of the documents: vAttrib:=OB Get([MyDocuments]My4DWP;"myatt_Last edition by")
See also
|
PROPERTIES
Product: 4D HISTORY
Created: 4D v14 ARTICLE USAGE
4D Language Reference ( 4D v16) |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||