Record Class Properties

In this section, we discuss the Record class properties. The properties are listed in alphabetical order.

Description

This property returns the total number of fields contained in the record. This value is a number.

This property is read-only.

Example

WinMessage("This record has this many fields : " | &REC.FieldCount);

Description

If a field name is used as a property, it accesses the field object with that name. This means the following code:

&REC.fieldname

acts the same as

&REC.GetField(FIELD.fieldname);

Note: If the field you’re accessing has the same name as a record property (such as, Name) you can’t use this method for accessing the field. You must use the GetField method.

If you combine the fieldname property with the recname property, you obtain the specified field object associated with that record from the row.

&ROW.recname.fieldname

This property is read-only.

Example

&REC.CHARACTER.Enabled = True;

Description

This property returns True if any field value on the primary database record of the row has been changed.

Note: This property is for use only with the primary database record. It does not return valid results if used with a work record.

This property is read-only.

Considerations Using IsChanged

This property and the IsChanged row property do not always return identical values.

If a row in a scroll contains multiple records (such as a primary database record and one or more work records), the IsChanged row property returns True if any of the records in the row are changed. The IsChanged record property returns True only if a specific record, namely, the primary database record, is changed.

If a row is deleted from a scroll, only the primary database record has its IsChanged property marked to False (since the row has been deleted.) Any work records in the row still have their IsChanged properties set to True.

Example

If &REC.IsChanged Then
    Warning("This Record has been changed");
End-if;

Description

This property is True if the record has been deleted. For a level zero record, it is possible for a record to be deleted without the whole row being deleted. For other levels, this property is the same as the row property IsDeleted.

This property is read-only.

Example

&tmp = &REC.IsDeleted;

Description

This property is True if an error has been found for any field associated with the record after executing the ExecuteEdits method. This property can be used with the Field class properties EditError (to find out which field is in error), and MessageSetNumber and MessageNumber to find the error message set number and error message number.

The IsEditError property returns True when a field with a Null value is encountered.

This property is read-only.

Example

The following is an example showing how IsEditError, along with the ExecuteEdits method could be used:

&REC.ExecuteEdits();
If &REC.IsEditError Then
 For &I = 1 to &REC.FieldCount
   If &REC.GetField(&I).EditError Then
      LOG_ERROR();  /* application specific call */
   End-If;
 End-For;
End-If;

Description

This property returns the name of the record definition of the record as a string.

To access an SQL table name for a record, use the %Table meta-SQL construct.

This property is read-only.

Example

WinMessage("The name of this record is : " | &REC.Name);

Description

This property returns the row object for the row containing the record. If the record object was created with the CreateRecord built-in function, the value for ParentRow is null because the record object isn’t part of a row.

This property is read-only.

Example

&ROWOBJECT = &REC.ParentRow;
    &TMP = "The row number of the parent row is " | &ROWOBJECT.RowNumber;
/* note that RowNumber is a property of the row class  */ 

Description

This property returns the name of the related language record as a string. The value will be a null string ("") if there is no related language record.

Example

Local Record &REC;

&REC = GetRecord();
&RECNAME_BASE = &REC.Name;
&RELLANGRECNAME = &REC.RelLangRecName;
SQLExec("select RELLANGRECNAME from PSRECDEFN where RECNAME = :1", &RECNAME_BASE, &RELLANGRECNAME);

Description

Note: PeopleSoft Mobile Agent is a deprecated product. This mobile property currently exists for backward compatibility only.

This property returns the name of the System ID field as a string. If there is no defined value (the default) the value is a null string ("").

This property accesses the System ID field name value specified on the Use tab of the Record Properties dialog box.

The System ID field is used to create a unique way to identify the record for mobile synchronization purposes. This property is used exclusively for mobile applications. This property is not available for subrecords.

This property is read-only.

Example

Local Record &REC;

&REC = GetRecord();
&sSystemID = &REC.SystemIDFieldName;

Description

Note: PeopleSoft Mobile Agent is a deprecated product. This mobile property currently exists for backward compatibility only.

This property returns the name of the Timestamp field as a string. If there is no defined value (the default) the value is a null string ("").

This property accesses the Timestamp field name value specified on the Use tab of the Record Properties dialog box.

The Timestamp field is used to specify a field that is automatically updated with the date and time when there's a change to the record. This property is used exclusively for mobile applications.

This property is not available for subrecords. This property is read-only.

Example

Local Record &REC;

&REC = GetRecord();
&sTimeStamp = &REC.TimeStampFieldName;