You need to sign in to do that
Don't have an account?
mibrop
Attachment Recordset Problem in Flex (possibly not Flex related)
I extended the Flex sample app to populate a DataGrid with the Id and Name of Attachment objects from Salesforce.
However, I've encountered an issue where if I attempt to put the Id and Name in the same row in the DataGrid, it fails. However, if the Id and Name are on separate rows (two separate ArrayCollection.addItem statements) then it works. This happens with any query where I bring back multiple fields and attempt to show them in the same row in the DataGrid.
Here's a snippet of the relevant code that does not work:
However, I've encountered an issue where if I attempt to put the Id and Name in the same row in the DataGrid, it fails. However, if the Id and Name are on separate rows (two separate ArrayCollection.addItem statements) then it works. This happens with any query where I bring back multiple fields and attempt to show them in the same row in the DataGrid.
Here's a snippet of the relevant code that does not work:
private function render():void{
apex.query("Select Id, Name FROM Attachment",
new AsyncResponder(
function(qr:QueryResult):void{
var ar:ArrayCollection = new ArrayCollection();
for (var j:int=0;j<qr.records.length;j++) {
ar.addItem( {Id:qr.records[j].Id}, {Filename:qr.records[j].Name} );
}
bg.columns = [new DataGridColumn('Id'), new DataGridColumn('Filename')];
bg.dataProvider = ar;
},
function (fault:Object):void{
}
));
}
However, the following code does work:
private function render():void{
apex.query("Select Id, Name FROM Attachment",
new AsyncResponder(
function(qr:QueryResult):void{
var ar:ArrayCollection = new ArrayCollection();
for (var j:int=0;j<qr.records.length;j++) {
ar.addItem( {Id:qr.records[j].Id} );
ar.addItem( {Filename:qr.records[j].Name} );
}
bg.columns = [new DataGridColumn('Id'), new DataGridColumn('Filename')];
bg.dataProvider = ar;
},
function (fault:Object):void{
}
));
}
Try replacing:
Mike
Seattle