User Guide > Scripting > Using Scripts to Perform Specific Tasks > Using DJRecord and DJField Objects to Access Metadata
Was this helpful?
Using DJRecord and DJField Objects to Access Metadata
Refer to a DJRecord object by entering RecordAt("/SOURCE/recordname"). For details on this object, see DJRecord Object Type.
Refer to a DJField object by entering FieldAt("/SOURCE/recordname/fieldname"). For details on this object, see DJField Object Type.
Example
Description
EZscript Code
Name
Returns the name of a field.
FieldAt("/SOURCE/R1/FieldName").Name
FieldCount
Returns the number of fields in a record.
RecordAt("/SOURCE/R1").FieldCount
TypeName
Returns the data type of a field.
FieldAt("/TARGET_1/R1/FieldName").TypeName
Field Contents
Returns the contents of a field.
FieldAt("/SOURCE/R1/FieldName").Value
Field Length
Returns the field length values.
LogMessage("Info", "src.AcctNo.Length = " & FieldAt("/SOURCE/R1/Account No").length)
CurrentRecordType
Returns the record type of a source.
Note:  This is not valid on targets, except when using the DJImport object variable.
RecordAt("/SOURCE/R1").currentrecordtype
Last modified date: 02/01/2024