I am trying to create an APEX class in Salesforce which sends an SMS. This is called from a Lead Trigger.
I want to pass a ‘Lead’ into the method but get the following error
“Unsupported parameter type SOBJECT:Lead”
My declaration looks like this.
global class SMS_Services {
@future (callout=true)
public static void SendTestDriveReminder(Lead l){
}
}
This is because you have annotated the method as @future future methods can only accept primitive parameters. So you would need to change the parameter type to Id for example:
The important thing to note is that I have recommend you change your parameter from a single record to a set of Id’s this is because you should be bulkifying your trigger
You only get a small amount of future methods each day, you need to use them sparingly