[SalesForce] Pass List to @Future

I have the following list in a trigger.

list<Employees__c> employeesToUpdate   = new list<Employees__c>();

I want to pass the list to a Future method. All I really need is the ID of the Employee__c record.

I am getting the following error from my future method.

Unsupported parameter type List<Employees__c>

Here is my future method:

public class EmployeeBenefitSummaries {
    public static void generateSummaries( List<Employees__c> emps) {
        // Get Employee and sessions for counts

Best Answer

According to the documentation here:

Methods with the future annotation must be static methods, and can only return a void type. The specified parameters must be primitive data types, arrays of primitive data types, or collections of primitive data types. Methods with the future annotation cannot take sObjects or objects as arguments.

You'll have to pass a List<Id> rather than a List<Employee__c>.