Last Updated on July 26, 2021 by Rakesh Gupta
As of this point, we have completed several trails on Trailhead and are counting! As a result, we have amassed theoretical knowledge and have some practical experience. But, since our drive to learn Salesforce is insatiable, we want more!
Learning by doing is the key. So, let us look at several hands-on scenarios. By practicing, let us figure out how to identify, design and implement the best solution to solve a problem or a requirement.
Here is the game plan – take bite-size use cases and work on solving them. If you are stuck or get frustrated, reach out to me – I will guide you towards the solution but not solve it for you!
Why just me? It is very likely that a fellow-trailblazer may be your guide instead – remember that, when one teaches, two learn!! So, get the ball rolling and knock out the following use cases!!
Before that check out the previous exercises:
Hands-on Excercise
Tim Robinson has recently started working as a Salesforce Developer at GoC. He is using Trailhead and Automation Champion articles as one of the primary resources to learn Apex.
Tim received a requirement from his technical architect to write an Apex trigger that accomplishes the following:
-
- Create a new lead whenever a new user (with profile Marketing User) is created, also add the user into following Public group and Queues:
- General Announcements (public Group)
- Marketing Hot Leads (Queue)
- Newsletter Signup (Queue)
- Then auto assigns the following permission set:
- Create a new lead whenever a new user (with profile Marketing User) is created, also add the user into following Public group and Queues:
-
-
- View and Edit Converted Leads (Custom Permission Set)
- Modify All Leads (Custom Permission Set)
- View All Data (Custom Permission Set)
-
Proofreader: - Munira Majmundar
Hi Rakesh,
Based on your Apex Exercise – 2 I was able to change the user group and permission set but when I put the if conditonn to check the profile of the user the trigger doesn’t hit.
for(User U : Trigger.New) {
if(U.Profile.Name==’Read Only’)
Please let me know how to proceed.
First, you need to write a query to find user’s profile or use a global variable to find the logged-In user profile details
Dear Raksh,
I worked on the Apex exercise 1 & 2 that you have provided. I would like to have this reviewed by you and provide feedback and also want to more and more such kind of exercises like that.