Retrieve values from foundset

I am working with foundset, I need to load records in foundset programmatically only those record (specifically columns) that user enters in forms elements. Is it possible to load records?

Foundset returns entire record if I select particular index.

efoundset.getrecord(1) // returns entire first row

How to get particular value in entire record?

Welcome to Servoy!

To load only certain records, there are different options, but in your case I think the best option is to use find mode. Here is a wiki page with some examples.

To get a value for the currently selected record, you can just use the column name:

efoundset.yourcolumnname

To get a value for a different record you can use the getRecord() function like this:

efoundset.getRecord(yourindex).yourcolumnname

or with a step in between to be more clear:

var _rec = efoundset.getRecord(yourindex);
_rec.yourcolumnname

Thanks for your quick respond.

I went to above above link. That is very helfpful

Can you guide me i am getting error for the below code.

 efoundset.loadRecords('SELECT emp_id FROM employee WHERE emp_id=? ORDER BY emp_id')  
efoundset.find();
emp_id=<somevalue>; //Getting ERROR for column name  as  The value is not set for the parameter number 1
efoundset.search();

if the emp_id is the primary key of your employee table then it is as simple as:

efoundset.loadRecords(<somevalue>);

otherwise you can either use:

efoundset.loadRecords('SELECT emp_id FROM employee WHERE emp_id=? ORDER BY emp_id', [<somevalue>]);

or

if (efoundset.find()) {
	efoundset.emp_id=<somevalue>;
	efoundset.search();
}

Thats so simple.

Thank you very very much