Have you ever been stuck on a tough problem for work or fun when trying to build that most epic Apex class? Has Visualforce tripped you up some how and the only way you are going to figure it out is by googling for the answer? When you find that answer has it ever come in the form of the Salesforce Developer Forums? I’m going to go ahead and answer all of these questions for myself with one simple answer. Yes.
The great thing about developer.salesforce.com is that it isnt just a place to go and find an answer but to leave an answer as well. Living in a world where knowledge is power and the internet is at our fingertips brings the ability to bridge the gap of those seeking to share it and those seeking to gain it.
When I started on the platform 4 or 5 years ago I was hung up on what now I would call simple stuff and “The Basics”. I would never have dreamed of being confident enough with my own abilities to actually answer questions instead of just ask. Yet one day I decided I would start giving back to the community that helped me become a successful developer on the Salesforce platform.
It was through answering questions that I discovered my first real use case for invocable methods and the process builder. A person had need of a way of updating their Account record based on different child records being updated. Not the Account record. So I figured that what the person needed was to have triggers fire off of each of the multiple objects that would then have to query the other child objects in order to determine if the right criteria was present to change the parent Account record.
Enter the idea to use an invocable method, with this and the process builder I would not need to write multiple triggers. I could write 1 small Apex method and multiple processes instead. This was much faster, and much easier to scale in the long run. Processes in the process builder are a lot easier to deactivate should something be going wrong than a Trigger. Plus setting up a new set of criteria would be easier for less advanced users in the future!
Had I not seen this question on the developer forum I would never have come to my conclusion and I may not have finally found a great first use case for invocable methods.
Spending an hour or 2 every now and again answering questions on the developer forum can help you in the future in so many ways. The developers there that are struggling to find a solution could help lead you to an answer to a problem you do not even know you have yet. Learning does not have to only come from the answers of others, but their questions as well. A good student does not only ask, but knows when to listen as well.
https://sfdc.co/b0hTzP. ~ebook link