Update only selected records in view?

Update only selected records in view?

I'm not sure how to update only selected records.

At the moment when user select lets say 5 records in the view and execute custom function

void dateformat.updateDate()
{
for each ordered in Orders[Ordered=="Yes"]
{
ordered.Order_Date=zoho.currentdate;
ordered.Ordered="Yes";
}
}

It updates all records instead selected. I couldn't find anything that says how to isolate selected records from the view.

Could you please be kind and help me with this problem.

Thanks
Sasa