deleting a record object

Hi, I have this,

var vRecord = foundset.getRecord(foundset.newRecord())

this will give me the record as an object, very handy to pass thru to other methods as an argument.

But how can I delete this record, when I only have this object??

vRecord.deleteRecord() 

does not work!

I have stumbled about that, too. You can only delete by index. So this would work:

var vNewRecordIndex = foundset.newRecord()
vRecord = foundset.getRecord(vNewRecordIndex )
foundset.deleteRecord(vNewRecordIndex)

yeah, but in the meanwhile the foundset can be changed, so I don’t have that index! :-(

I think if your foundset is not “safe”, your record variable isn’t either.

yes it is, it’s just an object of the record itself, not via an index or so!

but i think I have found something!, I will post it, when I have tested it.

A record variable doesn’t live forever. If you change your foundset, your record might “die”. That’s what I meant. If you don’t touch your foundset, the record is fine, but then, so is the index…