RecordSet.setField

Availability

Usage

RecordSet.setField(index, fieldName, value)

Parameters

Parameter
Description
index
The index number of the record.
fieldName
The field name to replace.
value
The value to insert into the field.

Return value

Nothing.

Description

Method. Replaces one field of a record with a new value. When you use the setField method, avoid the following conditions:

Error handling

Error condition
What happens
Error message
The RecordSet object is server-associated but not fully populated.
No change is made to the RecordSet object, and an error message is reported to the Flash MX output window and Debug Console.
Operation not allowed on partial RecordSet objects.
Index out of range
The RecordSet object is not changed.


Unknown field name
The RecordSet object is not changed.


Example

The following example demonstrates the setField method:

#include "NetServices.as"
var productList =new RecordSet(["ProductName","Price","Color"]);
var itemToAdd ={ProductName:"magicbubbles",Price:1,Color:"0x987654"};
productList.addItem(itemToAdd);
var replacementValue ="flashmx";
productList.setField(0,"ProductName",replacementValue);

See also

Constructor for RecordSet, RecordSet.replaceItemAt

 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flashremoting/mx/Using_Flash_Remoting_MX/asDict42.htm