function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Mark Korf 6Mark Korf 6 

Getting an error in my code. Can someone please review and let me know what I'm doing wrong?

Hello,

Trying to build a Slack notification in apex like the one in the following picture.

User-added image

Here is my code. As you can see my error is on line 15? 

User-added image

Thanks in advance.
Mark
Etienne Rocheleau 9Etienne Rocheleau 9
The error tells you what you need to do,

your class: QueueableSlackCall needs to have a method called execute that takes a QueuableContext in parameter.

This is because you implement System.Queueable and that requires you to add that method to any class implementing it.

You can read more on Queuable here:

https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_queueing_jobs.htm
Mark Korf 6Mark Korf 6
Etienne,

Thanks for the quick response. First, I'm a 'Developer - Embryonic Stage' so while I see what it is telling me to do, I don't have the developer knowledge yet to fully understand it. I read through the article you sent but am still unsure where to add the execute method, nor what it should look like.

Still open to advise. Thanks!
Mark