Custom Action executes only on one record

Custom Action executes only on one record

Hi,

I configured a custom action in the report header. The code is only one line, updating a field in a record.

void WalkIn.OrderManager.MarkTasksPaid(Task_Subform t)
{
    t.Payment_Status = "Paid";
}

I don't understand the help document:  https://www.zoho.com/creator/help/script/custom-actions.html#Configure_the_function_as_custom_action_-_in_View_Header

  1. n the Execute action for each record, the custom action will be called for each record. This is supported for functions with any argument type.
  2. In the Execute action for collection of records, in which case the custom action will be called for a set of records.
For 1. If the function can take any argument type, how does it know what type of record it's acting on???

For 2, "will be called for a set of records", which set? the one the user checked in the report? or the records that meet the "Criteria" in the configuration page?

I tried a combination of settings for 1 and 2. It only updates one record for me, even though the user checked multiple records in the report. Do I need to write a for-loop or something? Help! The documentation is very unclear and confusing.