Salesforce Trailhead for Developers

Salesforce Trailhead for Developers

What is Trailhead?

Trailhead is an interactive learning methodology through the essential building blocks of the Salesforce1 Platform. It is better than ever, simpler approach to learning Salesforce. With this system, you can test your knowledge of the platform while gaining points and badges to celebrate your accomplishments. Trailhead gives developers and administrators a guided, learning path through the key components of Salesforce, utilizing an arrangement of intuitive, online instructional exercises.

Who can use Trailhead?

The introductory content for Trailhead was targeted towards beginners and intermediate developers. Since its launch, Salesforce.com has covered more advanced subjects; thereby making Trailhead a helpful asset for developers and administrators at all levels of experience. The long haul objective of the Trailhead venture is to change how clients learn how to utilize Salesforce, by drastically rearranging and reclassifying the learning experience by making it simpler.

Why Trailhead stands out?

Some key features of Trailhead are:

Well, Planned Content – Trailhead content is composed of units, modules, and trails to help guide you through all that you need to know about the Salesforce1 Platform.

unit takes you through several learning objectives for an element or tool of the Salesforce1 Platform in order to reinforce the learning objectives by means of challenges.

module is a progression of units for a specific branch of knowledge. Once you’ve finished all the units in a module, you will acquire a badge to be displayed on your Salesforce Developers profile. There are presently 30 modules on trailhead with some recent additions like Accounts & Contacts, CRM basics, Event Monitoring, Leads & Opportunities etc.

trail is a progression of Modules, composed in a guided learning path to help you face different parts of the Salesforce1 Platform. –This hierarchical arrangement of content in three levels, thus: trails, modules, and units, and presented in a particular grouping order, assists clients have a predefined learning path to take after, and they don’t need to invest energy choosing what to read and in what order.

  • Self-paced, online learning – you can realize what you need when you require it, by picking up a suitable trail. Trailhead applies the model of intelligent learning models made popular by sites, namely Code School, Codecademy, Udacity, Coursera, and Khan Academy, to the objective of learning Salesforce.
  • Modular and engaging, content – every instructional exercise comprises of short units, which can be read in 10-15 minutes each. The content is intended to be basic, independent, and specifically helpful, to augment the value of the learning experience.
  • Interactive evaluations – toward the end of every unit, you can take a test to check what you just learned, either by answering multiple-choice questions or performing particular tasks in a DE org. On finishing a test, you can click a button and get instant feedback on whether you got it right.
  • Gamification – points, and badges are granted when you finish fruitfully the units and modules, respectively. The points and badges are shown on your profile, so you can

These elements combine to make Trailhead a refreshing, new way to deal with learning, providing a more straightforward, less demanding, and all the more captivating choice to begin with Salesforce. Previously, it was troublesome for new clients to find out about particular item features despite the fact that a large amount of detailed and accurate documentation is available, it’s not generally clear what to read and in which order. The incorporation of content and assessment is another key factor in Trailhead’s quality as a learning device and separates it from alternate types of documentation and client assistance Salesforce provides.

How it compares to other resources?

Trailhead content is like the Doc team’s other deliverable like – online help, developer guides, and implementation guides, in the sense that they’re all expected to help clients figure out how to utilize Salesforce products and features. However, Trailhead gives more of a guided and curated learning background.

Every module is intended to be straightforward, particular, and independent. The objective is to give clients all the essential data needed to take in a feature—background, contextual, conceptual, and procedural—in one incorporated bundle.At the end of the day, every module clarifies what a feature is, why and when it’s helpful, and additionally how to use it, while being simple and concise. The docs most like Trailhead are exercise manuals, which give basic instructional exercises, acquainting clients to a particular area, through a progression of steps. However, workbooks can’t give intuitive evaluations. Additionally, the later steps in many workbooks require previous steps as prerequisites, so the client can finish a big undertaking, for example, constructing an application.

Trailhead units, then again (at any rate until further notice), are intended to be generally autonomous, so that despite the fact that they’re organized in a specific succession, you can pick and choose the content of interest without needing to experience all units in a module, or all modules in a trail. Collaboration between the Salesforce Developer Marketing and Doc teams, Trailhead was launched at Dreamforce 2014 and from that point forward, the site has been improved with new features and content regularly.In the course of last few months, the Trailhead team has been relentlessly enhancing the site: adding new features and expanding the list of topics covered.

In the most recent redesign, Salesforce likewise revamped the content into four new trails, conveniently distinguished by role and experience level.

 How much does Trailhead cost?

The cherry on the cake for you as a client is that all of the Trailhead content is available for free. You can view all learning content without even signing in, yet in the event that you need to keep tabs on your development, complete challenges, and earn points and badges, you will need to login to Trailhead. Signup here for a free Developer Edition if you don’t already have one.

Process Builder Vs Apex Triggers –  Choosing Between Automation Tools

Process Builder Vs Apex Triggers – Choosing Between Automation Tools

Process Builder Overview

Process Builder is a graphical representation of your process as you build it. It consists of

Criteria, Immediate and Scheduled Actions.

There are following things which can be done by process builder:

  • Create Records:In addition to updating a record, you can create a record and set the field values within the record.
  • Create Chatter Post:   Push a chatter update into Group or Feed.
  • Create an approval:Traditionally you needed a trigger to push a record into an approval process automatically. With Process builder, you can do this automatically based on criteria of the process.
  • Quickly consolidate Workflow:Quickly consolidate multiple workflow rules that in one process.
  • Call an Apex Class:You can now call an Apex class.

Trigger Overview

A trigger is the piece of code, that is executed Before or After a record is inserted or updated.

Usually, an APEX (code) based evaluation of criteria to set off a chain of events.These events execute the following types of operations

  • Insert
  • Update
  • Delete
  • Merge
  • Upsert
  • Undelete

In Apex Trigger you must have

  • Need to programming knowledge.
  • Need to design test classes to meet required test coverage.

But the main difference in process builder is you can not delete any record and can’t show any error. For these, you have to write Trigger code. For example:

Apex Limitations

  • Total number of records retrieved via SOQL queries                                       50,000
  • Total number of records retrieved by DML                                                        10,000
  • Total number of SOSL queries issued                                                                 100(Sync) | 200(Async)
  • Total number of SOSL queries issued                                                                 20
  • Total number of records retrieved by a single SOSL query                             2,000
  • Total number of DML statements issued                                                           150
  • Maximum number of characters for a trigger                                                   1 million

Process Builder Limitations

Editing: User can’t edit process once it has been activated.Therefore much like with flow, a new process needs to be created by cloning the initial process and making modifications to that cloned records.

Validation: Processes DO NOT  trigger Validation rule and can, therefore, invalidate data.

Deletion: The inactive process can’t be deleted for at least 12 hours after inactivation and do not appear in the Recycle Bin

Error Message: You can’t specify error messages when creating a process that doesn’t trigger as you can with flow or validation rules.

Formula help: When utilizing formula in criteria, there is no function help preview next to the syntax

Syntax: Pick-list fields are evaluated as text fields in process builder so that they won’t support any pick list formulas like ISCHANGED or ISNEW.

Apex Trigger Best Practices

  • Apex code must provide exception handling.
  • When query large data set use an SOQL FOR loop
  • Don’t use  SOSL and SOQL inside for loop.
  • Avoid Hard Coding IDs

Process Builder Best Practices

  • Check: To see if there are any workflows on the object doing the same things as the process. Also, verify no active Apex Trigger.
  • Avoid: Interviewing Apex, workflows, and processes together for the same process.
  • Document: Use the Description field to populate information such as when it was created by who and what the process does.Also, if processes work in conjunction with each other.
  • Test: And then test some more.Especially when you are first starting to use this please practice in the sandbox first.

There’s a lot of ability to impact users and data here if you do something wrong.

Now the question is Why Process Builder and how is it differ from trigger?

Process builder is fully customization. No code required here because we require lengthy logic and record to complete and fulfill the requirement or if we using process builder it will take less time to complete the requirement.

It has some benefits over the trigger:

SCENARIOS OPTION REASON
Scenario I

Populate a lookup field on record update:

Traditionally required a trigger and It can be done easily with process builder.

The issue is Multi layer lookup logic- i.e. multiple / nested maps of related data required in the trigger.

          Process builder Trigger Traditionally been something that requires a Trigger. Process builder allows administrator can do this without the use of the code.
Scenario II

Set an Account Owner based on Record criteria

Process builder

Trigger

Process builder can be used to assign ownership of records based on criteria in the object.
Scenario III

Post a chatter message based on record criteria

Process builder

Trigger

Process builder can be used to post to chatter based on record criteria.
Scenario IV

Submit a Quote for Approval when Opportunity Stage= Proposal

Process builder Trigger Requires 2 Processes one to Update the Quote based on the opportunity stage and another to submit the quote for the approval when the criteria on the quote had been met.
Scenario V

Launch a Flow via record criteria vs a button or link.

Process builder

Trigger

Process builder can be used to set record criteria and then launch a trigger ready flow.
Scenario VI

Clone an opportunity and change the field values

Process builder

Trigger

Although Process builder can create a new record it can’t reference any of the values from the cloned opportunity without the use of a flow to capture the opportunity values.

Let’s have a look on given Process builder example :

Allow Contact to copy Current User Address in Contact Address and Account Billing Address only when any address field(Street, Country, state )is blank/NULL.

Step 1:

Make your Process-builder on Contact Object. Provide the criteria as Contact.Mailing Street (IS NULL = FALSE) and likewise for every address fields of Contact and Opportunity.

Step 2:

In “Immediate Action” give reference of Mailing Country to that of Contact.Owner.Country and Activate your Process as:

 Step 3:

Now test this process builder in your org by leaving any address field blank in your org.

Step 4:

After leaving Contact address blank here is the address which got autofilled same as contact’s owner address. Similarly you can test this for your Contact’s Account.

This is the reason for using Process builder rather than using Apex. But  in some scenarios you’ll have to write trigger code where process builder can’t be.

For example:

Create a checkbox field “SAME COUNTRY AS USER & COMPANY”. Throw error when a Contact is getting inserted in Salesforce having Country same as User country and Company country.

Above example can’t be done via Process builder since this do not allow you to throw error while inserting Contact.
Create  Checkbox field named “SAME COUNTRY AS USER & COMPANY” on Contact.

APEX CLASS:
public class SameUserAndCompanyCountryContact {

public static void sameCountry(List<Contact> conList){

   User user = new User();

   user = [SELECT Id , Country , CompanyName from User where Id =:UserInfo.getUserId()];

   System.debug('>>>>>>>>>>RB<<<<<<<<<<<<'+user);

Organization orgDetails = [ SELECT Name , Country , Address from Organization where Name =: user.CompanyName];

System.debug('>>>>>>>>>>>RB<<<<<<<<<<<<'+orgDetails);

for(Contact con : conList) {

  if(con.MailingCountry == user.Country && con.MailingCountry == orgDetails.Country){

   con.addError('Country of Company and User is same as country of Contact trying to insert');

     con.Same_Country_As_User_And_Company__c = True;

         }

      }

   }

}
APEX TRIGGER:
trigger ErrorOnSameCountry on Contact (before insert){
  List<Contact> conList = Trigger.new;
     if(conList!=null) {
       SameUserAndCompanyCountryContact.sameCountry(conList);

    }
}

Although the usage of process builder over apex trigger or vice versa is dependent on various other factors too, such as:

  • Complexity Of Codes.
  • Programmatic Logics.
  • Rapid Iteration In Process Builder Can Be Challenging.
  • Unit Test Considerations.

Pin It on Pinterest