The Item method returns a member object of the collection. The class of the object depends on the collection; for example, calling the Item method of the Fields collection returns a Field object. Specify the member you want by passing its name or index.


Item(ItemName as String) as Object

Item(Index as Integer) as Object

The name of the member to return an object for.

The index of the member to return an object for.

Return Value
A reference to the member object if it exists or null if not.

This example, which could be used as the code for the DataEngine.GetCustomMetaData script for a project, changes the caption for a specific field. This is commonly used when the user can change the headings of fields in the application. Although this is shown as a hard-coded caption in this example, in actual use, you'd look up the caption for the field wherever your application stores it.

Visual FoxPro

lparameters toApplication as SQApplication
local loField as Field
loField = toApplication.DataEngine.Fields.Item('CUSTOMER.COMPANY')
loField.Caption = 'Organization Name'


function Main(Application)
dim Field
set Field = Application.DataEngine.Fields.Item("CUSTOMER.COMPANY")
Field.Caption = "Organization Name"
end function


function Main(Application) {
var Field = Application.DataEngine.Fields.Item('CUSTOMER.COMPANY') ;
Field.Caption = 'Organization Name' ;


public static bool DataEngine_GetCustomMetaData(SFQApplication sfqApplication)
  Field field = sfqApplication.DataEngine.Field.Item("CUSTOMER.COMPANY");
  field.Caption = "Organization Name";


public shared function DataEngine_GetCustomMetaData(sfqApplication as SFQApplication) _
    as Boolean
  Field field = sfqApplication.DataEngine.Field.Item("CUSTOMER.COMPANY")
  field.Caption = "Organization Name"
End Function

See also

AddItem | Collections