Home » Articles posted by Walid El Horr

Author Archives: Walid El Horr

The Salesforce ID, a Deep Dive!

Ever wondered what this long string of characters called the Salesforce ID means? How is it built? Will we ever run out of IDs? This post will dive into that!

 

What is a Salesforce ID and what is it composed of? 

In simple terms, a Salesforce ID is an identifier to a Salesforce record. As you know, Salesforce has Objects, like Account, Contact, Opportunity, Case, Custom Objects, etc… These are equivalent to Database tables: they are composed of different fields, or columns in Database terms, and records, or rows in Database terms. Each one of these row has a unique identifier: this is the ID! As an example the Account object:

  ID   Name   Type   Phone
  0015500000WO1ZiAAL
  KeJo Solutions   Partner   6475622230
  0015500000WOHciAAH
  Salesforce   Vendor   2023433443
  0015500000X29TXAAZ
  Universal Containers   Customer   6023345091

On top of records, the ID can be used to reference metadata elements, like Group, Queue, Record Type…etc. So, for example, whenever you create a Queue, guess what is associated to it? A Salesforce ID. 

Each ID is either a 15-character case-sensitive string, or an 18-character case-insensitive string. Let’s start by how a 15-character ID is composed:

Each one of the 15 characters can be:

  • A lowercase letter (a-z) – that is 26 possibilities 
  • An uppercase letter (A-Z) – that is 26 possibilities again
  • A Number (0-9) – that is 10 possibilities 

That would give us a total of (26 + 26 + 10 = 62) possibilities for each character, therefore the ID is a base-62 string. 

 

Now, let’s talk about the different components of the ID. To do that, we will use the above Account record ID:

0015500000WO1ZiAAL

Which we can divide into these distinct parts:

001 55 0 0000WO1Zi AAL

 

Here’s the meaning of each part:  

  Character    Example   Meaning
  char 1-3 (3 chars)   001   Key Prefix
  char 4-5 (2 chars)   55   Instance
  char 6 (1 char)   0   Reserved
  char 7-15 (9 chars)   0000WO1Zi   Unique identifier
  char 16-18 (3 chars)   AAL   Case-insensitivty checksum
  • Key Prefix (3 characters): Determines the type of record. With the first 3 characters, you can know which type this ID belongs to! For example, when you read 001, this is an Account ID, 005 is a User ID, 006 is an Opportunity, 00Q is a Lead, 500 is a Case, etc…

 

  • Instance (2 characters): Determines the Instance or server on which the record has been created on. For example, I just created an Account on my developer org, which is hosted on the instance UM3, the 4th and 5th characters of this Account were 4H, which means that 4H idetifies the UM3 instance. Note that a while back, only the 4th character was used to identify the originating Instance, and the 5th was reserved, but think of what happens when Salesforce was about to get 62 Instances? Clearly a single character was not sufficient to identify the originating Instance anymore, hence the use of the 5th character in addition to the 4th. That would give a theoretical max of 62^2 = 3,844 possible Instances.

 

  • Reserved (1 character): Reserved for future use! Would Salesforce ever tun out of instance identification with 2 characters? You never know! (I did the math, if we add the 3rd character to the Instance identifier, that would give a whoping 238,328 possible Instance identifications). 

 

  • Unique identifier (9 characters): this is what identifies the record, and the possible combinations is HUGE: 62^9 possible combinations, to be precise 13,537,086,546,263,552! 

 

  • Unique identifier (3 characters): Used to allow for an ID to become case insensitive. Why we need this? Well, imagine working with applicaitons like Access which do not recognize that 50130000000014c is a different ID from 50130000000014C, an 18-digit, case-safe version of the ID was introduced. The case-insensitive ID is identical to the 15-character case-sensitive ID, but with these 3 extra characters appended to indicate the casing of each of the original 15 characters. This way, 18-character IDs can be safely compared for uniqueness by case-insensitive applications. Here is a way to convert 15-char to 18-char IDs. And here’s a website for the same. Are you interested to know the technical details of how these 3 characters are calculated? Check this page!

 

Some Record ID Key Prefixes

Here are some Key Prefixes. Next time you read an ID that starts with 001, know this is an Account ID!

 Entity   Key Prefix
  Account   001
  Contact   003
  User   005
  Organization   00D
  Group   00G
  Report   00O
  Task   00T
  Event   00U
  Profile   00e
  Lead    00Q
  ContentDocument   069
  ContentDocumentLink   06A
  WorkOrder   0WO
  ServiceAppointment   08p
  Dashboard   01Z
  PermissionSet   0PS
  Campaign   701
  CaseComment   00a
  Order   801

 

Determine the record type using some code:

Finally, here is a tiny code snippet that can be used to get the record type from the ID. You can invoke it from any class, or from Anonymous Apex: 

// Sample Id
Id myID = '00561000000Mjya'; 
System.debug('This record is a '+ myID.getsobjecttype());
// Output is: "This record is a User"

Lightning Flow to copy File Links from Opportunity to Account

 

Use Case: 

As a Salesforce Admin, you are requested to copy all the Files attached to an Opportunity to its parent Account whenever the Opportunity is Closed-Won. This way, the Account record will have each file added to any of the Opportunities of the Account. 

 

A little bit of background:

To tackle this requirement, we should first understand the data model behind Files and how they are attached to records in Salesforce. 

The Data model for Content Document is:

 

The key objects to understand

  • ContentDocument: Represents a document that has been uploaded to a library in Salesforce CRM Content or Salesforce Files
  • ContentDocumentLink: Represents the link between a Salesforce CRM Content document or Salesforce file and where it’s shared. A file can be shared with other users, groups, records, and Salesforce CRM Content libraries. Fields of this object:
    • ContentDocumentId: is the Id of the ContentDocument
    • LinkedEntityId: ID of the linked object. Can include Chatter users, groups, records (any that support Chatter feed tracking including custom objects), and Salesforce CRM Content libraries.
    • Visibility: picklist with 3 values. ‘V’ for Viewer permission – the user can explicitly view but not edit the shared file. ‘C’ for Collaborator permission – the user can explicitly view and edit the shared file. ‘I’ for Inferred permission. The user’s permission is determined by the related record.
    • ShareType: picklist with 3 values. AllUsers – the file is available to all users who have permission to see the file. InternalUsers – the file is available only to internal users who have permission to see the file. SharedUsers – the file is available to all users who can see the feed to which the file is posted.

So, to simplify, anytime you upload a File via the Files related list, you create a ContentDocument and a ContentDocumentLink that links the ContentDocument to the record! Simple. 

 

Solution:

To tackle this requirement, we’re going to use Lightning Flow (Process + Flow). The process will be simply used to call the Flow when the Opportunity is Closed-Won, and to pass the Id of the Opportunity to the Flow. The process will be created AFTER the flow.

The Flow will be used to:

  1. Get the Opportunity details (mainly the AccoundIt field)
  2. Get all ContentDocumentLinks that are associated to the Opportunity and put them all in a single sObject Collection Variable
  3. Loop through these ContentDocumentLink records
  4. On each pass, add a new ContentDocumentLink record to a Collection Variable – but specify that the LinkedEntityId is the AccountId
  5. Finally, create the collection of ContentDocumentLink. This way, the links will be available on the Account

Here’s the final flow:

 

To begin, let’s create the Autolaunched Flow:

 

The first thing to do is to create the recordId variable. This variable will be used by the process to pass the Id of the Opportunity. Make sure you make it “Available for Input” as the process will pass the Opportunity Id to this variable. 

 

Now, we’ll use recordId to the the Opportunity record and store it in sov_Opportunity. Field to include is AccountId. 

 

Next, let’s get the ContentDocumentLink records that reference the Opportunity via the LinkedEntityId field. We store all these records in the variable socv_CDL_Opty.

 

We’ll now loop hrough this list of ContentDocumentLink records, and on each pass, we’ll assign a new record of ContentDocumentLink, then add it to the collection. The variable socv_CDL_Opty_Single is a single ContentDocumentLink record that will be used on each pass. Make sure to define it.

 

On each pass, 2 assignments will happen. The first is to assign a new ContentDocumentLink record, while specifyign the LinkedEntityId field to be the AccountId field retrieved from the first step.

The second assignment is to assign this single record to a collection of records.

 

And finally, we should create the ContentDocumentLink collection variable using the Record Create element:

 

The flow is done, we’ll now create the process that will simply call the Flow when an Opportunity is in the Closed-Won stage:

 

Here’s the Unmanaged Package that contains both the Flowand the Process. You can use it and modify it as needed, you can also use the same logic to apply for other objects and requirements.

For Production/Dev Edition:

https://login.salesforce.com/packaging/installPackage.apexp?p0=04t4P000002bJI8

For Sandbox:

https://test.salesforce.com/packaging/installPackage.apexp?p0=04t4P000002bJI8

Cheers,

Walid

Trigger to convert FSL Service Appointment time to the Service Territory timezone

Use case:

In Field Service Lighting, and upon scheduling Service Appointment to Resources, the system uses the local user’s Timezone to populate the Scheduled Start and Scheduled End date/time fields: 

But what if the Serivce Appointment location is in a Territory with different Timezone than the logged-in User’s Timezone? We need to find a way to capture the Scheduled Start Time in this Timezone as opposed to the default behavior that displays the Scheduled Start date time following the logged-in User’s timezone. Why? Well, what if we want to send a notification email to the customer informing them of the Scheduled Start time? It wouldn’t make perfect sense if it was not based on their local Timezone! 

As as example, if the Salesforce Dispatcher is in Toronto (Eastern Time), and the Service Appointment belongs to a Service Territory that follows the Pacific Time, then we need to see the Scheduled start date time in the Pacific, and not only in Eastern Time, and then we will use this local Scheduled Start in the email Template sent to the customer upon Dispatching for example. 

The data model is as follows:

  • Work Order is first created. It has a lookup to the Service Territory
  • The Service Territory has a lookup to the Operating Hour
  • The Operating Hour has a field called TimeZone that specifies the Timezone of this Territory 
  • Service Appointment can be created directly with the Work Order or after the Work Order. 
  • Service Appointment has a lookup to the parent Work Order 
  • Service Appointment has a lookup to the Service Territory, which has a lookup to the Operating Hour record, which has the TimeZone 

 

 

Upon creating the Service Appointment, the Scheduled Start date time is saved as the current Salesforce User Timezone! There is no way to get the Scheduled Start time on the Territory timezone!

 

A little bit of background:

There exists a method that deals with time conversion based on Timezones! Passing a day time field to a Format method returns the date time in the format specified, and following the timezone specified. For example: 

System.debug(System.now().format('YYYY-MM-dd HH:mm:ss', 'America/Los_Angeles'));

 

Returns the current time of the America/Los_Angeles timezone. 

17:35:08:002 USER_DEBUG [1]|DEBUG|2019-06-13 14:35:08

 

You can find all the available Timezone names here: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones

 

Solution:

To sort this, we will use a trigger that will use the format method to give the date time text value.

  • On the Service Appointment object, let’s create a custom field called Local_Scheduled_Start__c,
  • Let’s then create an After Insert and After Update Service Appointment Trigger 
  • Finally, we will create the Trigger Handler class that contains the method called by the Trigger

 

The Trigger is used to simply call a method on the Handler class:

trigger ServiceAppointmentTrigger on ServiceAppointment (after insert, after update) { 
    If (trigger.isAfter && trigger.isUpdate) {
        ServiceAppointmentTriggerHandler.handleAfterInsertUpdate(trigger.new);
    }
    
    If (trigger.isAfter && trigger.isInsert) {
        ServiceAppointmentTriggerHandler.handleAfterInsertUpdate(trigger.new);
    }
}

 

And now the Apex Class Handler that contains the method called by the Trigger:

public class ServiceAppointmentTriggerHandler {
    
    //Boolean to control recursion as this is after update
    public static Boolean boolStopRun = false;
    
    public static void handleAfterInsertUpdate(List<ServiceAppointment> triggerNew) {
        //Stop the run if this code was already run
        if (boolStopRun) return;
        
        //Make boolStopRun true in order to stop the run and prevent recursion - should be here not at the end 
        boolStopRun = true;
        
        //1- get all SA Ids
        Set<Id> setSAId = new Set<Id>();
        for (ServiceAppointment sa : triggerNew) {
            if (sa.SchedStartTime != Null) {
                setSAId.add(sa.Id);
            }
        }
        
        //2- Get List of SAs including the ServiceTerritory OperatingHours TimeZone
        List<ServiceAppointment> lstSA = [SELECT Id, AppointmentNumber, SchedStartTime, ServiceTerritory.OperatingHours.TimeZone
                                          FROM ServiceAppointment 
                                          WHERE Id IN : setSAId];
                                                 
        //3- create thge list with Local Scheduled Start and update it at the end 
        List<ServiceAppointment> lstSaToUpdate = new List<ServiceAppointment>();
        for (ServiceAppointment sa : lstSA) {
            //get the Timezone, returned value example "America/Los_Angeles"
            String strSTTZ = sa.ServiceTerritory.OperatingHours.TimeZone;
            //Passing a day time field to a Format method returns the date time in the format specified, and following the timezone specified
            String strLocalSchedStartTime = sa.SchedStartTime.format('MM/dd/YYY HH:mm', strSTTZ);
            ServiceAppointment saUpdated = new ServiceAppointment();
            saUpdated.Id = sa.Id;
            saUpdated.Local_Scheduled_Start__c = strLocalSchedStartTime;
            lstSaToUpdate.add(saUpdated);
        }
        update lstSaToUpdate;       
    }
}

And here’s the result:

Salesforce Ant Migration Tool Tutorial

I recently used the Ant Migration Tool for deployment and loved it compared to the slow Change Sets. The Ant Migration Tool is a Java/Ant-based command-line utility for moving metadata between a local directory and a Salesforce org. You can use it to deploy from any org to any other org, related or not, and it’s way faster than Change Sets.

Before you can use the Ant Migration Tool, Java JDK and Ant must be installed and configured correctly on your computer. If you already have JDK and Ant on your computer, you don’t need to install them, so first verify this from a command prompt.

If you don’t have Java JDK installed, follow these steps:

         

  • Click on JDK and note the installation path during the installation. My path was C:\Program Files\Java\jdk1.8.0_201
  • After installing JDK, verify the version by typing this command: java -version

If you don’t have Ant installed, follow these steps:

     

  • Extract the downloaded Zip to a directory that will be used as the Ant home. I extracted the Zip to D:\ANT_HOME

After installing both JDK and Ant, make sure you have these Environment Variables set: 

  • Add ANT_HOME and JAVA_HOME variables::
  • Right-click “This PC” – Properties – Advanced System Setting
  • Click Environment Variables

         

  • Add 2 new Variables called ANT_HOME pointing to your Ant installation folder D:\ANT_HOME, and JAVA_HOME pointing to the JDK installation folder C:\Program Files\Java\jdk1.8.0_201. Also, add these 2 folders to the Path variables as shown in the second screenshot.

        

It’s time to install the Ant Migration Tool itself:

           

  • And the sample Folder contains: 

          

  • The files build.properties and build.xml are 2 critical files. We will see about these in a while.

Let’s prepare the Ant Migration Tool!

  • To start using the Ant Migration Tool, we should first decide about the Source org, which will be used to get the metadata from, and the Destination org, which will be used to deploy the metadata to, from the Source org. 
  • The Source / Destination orgs can be of any edition (Developer, Production, Sandbox…), and they can indeed be not related at all 
  • Once you know the Source org, go to this tool https://packagebuilder.herokuapp.com/ to retrieve the manifest file package.xml. This file is an XML file that defines the metadata of the org. 
  • Specify the org type (Production or Sandbox), then click on LOGIN TO SALESFORCE WITH OAUTH, then enter your username and password.
  • In my case, the Source org is a Developer org with this username below: 

  • Click on Allow access to give access to the Package Builder tool for it to get the Metadata manifest package.xml file
  • Now choose the components you want, in my case, I will get all the components, excluding the managed ones, Then click on GET COMPONENTS 

  • Once you have the xml file displayed in the browser, select all its content, and copy it… then save it in a file named package.xml. If I can’t save an xml file directly from the browser, I save it as a txt file, then rename it using the “ren” windows command: ren package.xml.txt package.xml. This will rename the file from a txt extension to an xml one. 
  • Open the package.xml file using your preferred editor (I use VS Code to open my xml files), and go through it. You will notice that it is simply an XML file that contains tags corresponding to the different metadata components, just like when you choose components in a Change Set, but this is actually much faster! There is UI, and no need to wait 10 mins for the page to load!
  • The type of the component is inside the name tag, for example
    CustomApplication represents the list of all custom Apps components. MatchingRule represents the list of all Matching Rules components. You can choose to exclude all of the components of type MatchingRule by deleting the whole tag between <type>…</type> , including the corresponding opening and closing tags<type> and </type>. Also, you can delete individual components by deleting members tags instead and keeping the type and the name tags.

Here is the MatchingRule set of components between the <types> tag:

<types>
    <members>Account.Standard_Account_Match_Rule_v1_0</members>
    <members>Contact.Standard_Contact_Match_Rule_v1_1</members>
    <members>Lead.Standard_Lead_Match_Rule_v1_0</members>
    <name>MatchingRule</name>
</types>

  • Now, specify what metadata you want to keep – for example, in my case, I just want to deploy a custom App with its related metadata.
  • So, here is my final package.xml file that only includes what  I want to retrieve

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>CourseRegistrationHelper</members>
        <members>CourseRegistrationHelperTest</members>
        <members>CourseRegistrationTriggerHandler</members>
        <members>FlowClass</members>
        <members>FlowClassTest</members>
        <members>StudentHandler</members>
        <members>StudentHelper</members>
        <members>StudentHelperTest</members>
        <name>ApexClass</name>
    </types>
    <types>
        <members>CourseRegistrationTrigger</members>
        <members>StudentTrigger</members>
        <name>ApexTrigger</name>
    </types>
    <types>
        <members>LOGO</members>
        <name>ContentAsset</name>
    </types>
    <types>
        <members>College_Cloud</members>
        <name>CustomApplication</name>
    </types>
    <types>
        <members>Building__c.Description__c</members>
        <members>Classroom__c.Building__c</members>
        <members>Contact.Languages__c</members>
        <members>Contact.Level__c</members>
        <members>Course_Registration__c.Course__c</members>
        <members>Course_Registration__c.Student__c</members>
        <members>Course__c.Classroom__c</members>
        <members>Course__c.Name__c</members>
        <members>Course__c.Number_of_Students__c</members>
        <members>Student__c.Active__c</members>
        <members>Student__c.Date_of_Birth__c</members>
        <members>Student__c.Email__c</members>
        <members>Student__c.First_Last_Email__c</members>
        <members>Student__c.First_Name__c</members>
        <members>Student__c.Gender__c</members>
        <members>Student__c.Last_Name__c</members>
        <members>Student__c.Mailing_City__c</members>
        <members>Student__c.Mailing_Country__c</members>
        <members>Student__c.Mailing_Postal_Code__c</members>
        <members>Student__c.Mailing_Province__c</members>
        <members>Student__c.Mailing_Street_2__c</members>
        <members>Student__c.Mailing_Street__c</members>
        <members>Student__c.Phone__c</members>
        <members>Student__c.Summary__c</members>
        <name>CustomField</name>
    </types>
    <types>
        <members>Building__c</members>
        <members>Classroom__c</members>
        <members>Course_Registration__c</members>
        <members>Course__c</members>
        <members>Student__c</members>
        <name>CustomObject</name>
    </types>
    <types>
        <members>Building__c</members>
        <members>Classroom__c</members>
        <members>Course_Registration__c</members>
        <members>Course__c</members>
        <members>Student__c</members>
        <name>CustomTab</name>
    </types>
    <types>
        <members>College_Cloud_UtilityBar</members>
        <name>FlexiPage</name>
    </types>
    <types>
        <members>Building_Flow_calling_Apex_Class-1</members>
        <members>Building_Flow_calling_Apex_Class-2</members>
        <members>Building_Flow_calling_Apex_Class-3</members>
        <name>Flow</name>
    </types>
    <types>
        <members>Building_Flow_calling_Apex_Class</members>
        <name>FlowDefinition</name>
    </types>
    <types>
        <members>Building__c-Building Layout</members>
        <members>Classroom__c-Classroom Layout</members>
        <members>Course_Registration__c-Course Registration Layout</members>
        <members>Course__c-Course Layout</members>
        <members>Student__c-Student Layout</members>
        <name>Layout</name>
    </types>
    <types>
        <members>Building__c.All</members>
        <members>Classroom__c.All</members>
        <members>Course_Registration__c.All</members>
        <members>Course__c.All</members>
        <members>Student__c.All</members>
        <name>ListView</name>
    </types>
    <types>
        <members>Building__c.Flow_calling_Apes</members>
        <name>QuickAction</name>
    </types>
    <version>43.0</version>
</Package>

  • Create a folder that clearly specifies the project in the D:\AND_MIG_Tool folder. In my case, I created a folder called PD2__Shark. This folder will be used to retrieve metadata from the PD2 org, and deploy to another org called Shark – which is a Trailhead Playground org 😀  
  • Inside this Folder, create another Folder called codepkg
  • Copy the package.xml file in this folder D:\ANT_MIG_Tool\PD2__Shark\codepkg
  • Copy the 2 files build.properties and build.xml from the sample Folder to the Folder D:\ANT_MIG_Tool\PD2__Shark. We will rely on when retrieving and deploying the metadata
  • Open the build.properties file, and replace as per the below:
  • sf.username is the username of the Source org, sf.password is the password followed by the Token, and sf.serverurl depends on whether the Source is a Production (or Developer) edition or a Sandbox. 

Let’s use the Ant Migration Tool!

  • Now, everything is set to retrieve the actual metadata from the source org:
    • package.xml is ready
    • build.properties is modified with the source org credentials 
    • The folder structure is built
  • Open Command Prompt, and go to the project folder D:\ANT_MIG_Tool\PD2__Shark
  • Issue the command

ant retrieveCode

 

 

  • This will fetch the metadata from the source org, and add  them to the folder D:\ANT_MIG_Tool\PD2__Shark\codepkg
  • Now, to deploy this metadata to the Destination org, we need to change the credentials in the build.properties file. We need to replace the username / password+token and server URL with the right Destination values
  • Issue the command: ant deployCodeCheckOnly

 

ant deployCodeCheckOnly

 

  • This will Validate the deployment without actually deploying it on the Destination org. Just like your standard Change Set validation. In fact, you can see the validation result on the Destination org as well on the Command Prompt 
  • Finally, to deploy the components, we will issue the command: 

 

ant deployCode

 

Here is a list of all commands that can be used with Ant:

Command Description
ant bulkRetrieve
Retrieve all the items of a particular metadata type
ant retrieveUnpackaged
Retrieve an unpackaged set of metadata from your org
ant retrievePkg
Retrieve metadata for all the packages specified under packageNames
ant deployUnpackaged
Deploy the unpackaged set of metadata retrieved with retrieveUnpackaged and run tests in this organization’s namespace only
ant deployZip
Deploy a zip of metadata files to the org
ant deployCode
Upload the contents of the “codepkg” directory, running the tests for just 1 class
ant deployCodeNoTestLevelSpecified
Shows deploying code with no TestLevel sepcified
ant deployCodeRunLocalTests
Shows deploying code and running tests only within the org namespace
ant undeployCode
Shows removing code
ant retrieveCode
Retrieve the contents listed in the file codepkg/package.xml into the codepkg directory
ant deployCodeCheckOnly
Shows check only; never actually saves to the server
ant quickDeploy
Shows quick deployment of recent validation.
ant cancelDeploy
Shows cancel deployment of deploy request either pending or in progress
ant listMetadata
Retrieve the information of all items of a particular metadata type
ant describeMetadata
Retrieve the information on all supported metadata type

 

Finally, here is the Ant Migration Tool implementation Guide from Salesforce. 

https://developer.salesforce.com/docs/atlas.en-us.daas.meta/daas/meta_development.htm

 

Cheers!

Walid

The Complete Salesforce Certified Platform Developer I Course

Hey Folk,

Great News! I just finished recording and uploading the Complete Salesforce Certified Platform Developer I Course on Udemy.

This is a 14-hour course that I have designed and built to be 100% aligned with the official exam Study Guide of the latest Winter 20 Salesforce Certified Platform Developer I release, and I will be updating it on each subsequent release if necessary. I am currently running a promo during July with a heavy discount on this course. Just click on this LINK to access the discount course page.

The official Study Guide has the following Sections, and each Section has many Topics within it:

  1. Salesforce Fundamentals – 10%
  2. Data Modeling and Management – 12%
  3. Logic and Process Automation – 46%
  4. User Interface – 10%
  5. Testing – 12%
  6. Debug and Deployment Tools – 10%

Each topic mentioned in the Study Guide under each Section above is covered in this course, and each topic has at least a video lecture that is divided into a presentation, and a demo on the Salesforce environment. Some topic have up to 5 lectures, like the SOQL, SOSL and DML topic that is under Section 3!

I am sharing all the slides in PDF so that you could download them and read them offline, and I am also sharing a lot of reference links in each lecture. These reference include links to Trailhead modules, links to the sources I have used to build the slides, links to official Salesforce documentation related to the topic, and links to official Salesforce guides and eBooks.

This course also contains more than 100 quiz questions, none of them are from dumps. I HATE dumps, I have never used them in my IT certifications, and I don’t want you to pass this exam based on a bunch of questions from dumps! The questions in this exam are 100% dump free, and they are all designed based on the course content and on real-life scenarios.

Finally, I have been there, I spent hours and hours preparing for this exam, I dissected each and every topic of the Study Guide, and took tons of notes, just like I did when preparing for my other certifications. I guarantee that after completing this course, and after practicing on the Salesforce environment, you will pass this exam, and you will become Salesforce Platform Developer I Certified!

Good Luck!

Walid

Tip: Convert Lead without Opportunity Button

Business Case:

  • By default, when you convert a Lead to an Opportunity, an Opportunity gets generated.
  • You can stop the creation of an opportunity by checking the checkbox “Do not create a new opportunity upon conversion”
  • This Tip is to allow users to have a Button that converts Leads without creating an Opportunity

Tip Recipe:

  • On the Lead Object, on the Lead Conversion page, create a new Button “Convert without Opportunity”
  • This Button will automatically check the box “Do not create a new opportunity upon conversion”

Tip Steps:

  • Get the default Lead conversion URL by opening a Lead and clicking on “Convert” Button

  • Copy the URL part after the domain name:
  • https://walidsc-dev-ed.my.salesforce.com/lead/leadconvert.jsp?retURL=%2F00Q0Y000002U5s5&id=00Q0Y000002U5s5
  • Go to the Lead Object page: Setup | Build | Customize | Leads | Buttons, Links, and Actions – click on new Button
  • Fill as per the below

  • Note that we changed the actual ID of the Lead with the Merge Field “Lead ID”
  • We have also added “&nooppti=1” after the second Lead ID Merge Field. This is the argument that automatically checks the checkbox
  • Save and add the Button to the Page Layout (new buttons are not automatically added to the page layout)
  • Open a Lead, and click on “Convert without Opportunity”, you will get the checkbox “Do not create a new opportunity upon conversion” checked by default:

That’s it! J

Build a simple Salesforce Community and give access to External Users

Still studying for the Sales Cloud Consultant certificate. Chapter 8 of the Study Guide is about Communities and Site Management, so why not dig deeper into this subject and build a Community!? Here we go!

The first part of this post is mainly about Communities, its License models

  • Communities are branded online spaces that allows you to connect with your employees, customers and partners
  • It is a way to leverage the information that your customer and your employees have to work together
  • Example of a well-known Community: Salesforce Customer Success Community… I am sure many of you are already contributing to it!
  • A Community can target your Customers, your Partners or even your internal Users. It can also target more than 1 of these user types.
  • An example of an internal Community is a company intranet portal, where Employees can use chatter, ask questions, check Articles, share ideas, open internal Cases… etc.
  • An example of a Community for your Customers:
    • Support community: where customers can check your Articles, ask questions, open cases…etc. (Customers and Employees can be part of such Community)
    • Event Registration Community: chatter, events, Registrations, Q&A, Articles, Ideas…

Steps to build Communities:

 

How Communities work?

  • Communities live inside Salesforce org, and allow you to give external members access to subset of yoru date.
  • Access is controlled through community profiles and roles that integrate with your Security model
  • The external contact will also be Users of your Org.
  • Community Licenses are a special type of Licenses. They are listed below.
  • Developer Edition has 5 License count of the below Community licenses
License Use Example
Customer Community
– Named User based
– Login count based
B2C Communities with high volume of users
– Max 10M Users
Communities where you can access knowledge articles, or QA for Products and Services
Customer Community Plus
– Named User based
– Login count based
B2C or B2B Communities for Support and non-sales scenario
– Max 1 M User and 500K Account Roles
All above +Role Hierarchy +Sharing +Delegated Admin +Reports & Dashboards
Partner Community
– Named User based
– Login count based
B2B Communities with Access to CRM Data and PRM features
– Max 1 M User and 500K Account Roles
All above +CRM

  • Max Community Users:

  • Login vs. Named Users Licenses.
    • Member based (Named Users): Each user consumes a License
    • Login based: monthly pool of Licenses – you are paying baed on the number of Logins you consume!
    • Login based is based on a 12-month usage, if 100 logins per month, you can have months more than 100.
      • To know the logins, install AppExchange package: Salesforce Community Management.
      • Another App: OSF License Optimizer to re-assign user to the right license based on usage, if you have a mix of license types.
  • Careful: No Migration across license Type! Make sure to pick the right license from the start!
  • Make sure you choose an adequate Domain name:
    • mydomain.force.com/communityname
    • once you choose a domain name, it cannot be changed

(more…)

How to enable Salesforce Multi-currency, and what are its implications?

Hey folks!

As part of my study for the Sales Cloud Consultant certificate, I cam across Multi-currency, how to enable it, how to configure it, the difference between the Corporate currency and the different currencies that you add, what about the conversion? What currency show in the Reports? In the Dashboard?… Lots of stuff to worry about. Initially I thought it was a complex thing, but then after studying it,it is very simple! And here I am, summarizing this topic in this post.

Initially, when you create your Organization in Salesforce, you choose a single currency, and work on your Records using only this currency. This is the standard approach. What if your company has many branches in many countries? What if your company requires multiple currencies? Here comes multi-currency!

Before enabling multi-currency, check the implications of enabling this features:

  • After being enabled, multiple currencies can’t be disabled for your organization
  • Enabling this feature needs lockout duration that depends on the data space used by your organization.
  • The currenct Currency Locale will become the default currency stamp
  • Upon enablement, existing records are stamped with a default currency code that you provide in your enablement request
  • After enablement, all currency fields display the ISO code of the currency before the amount. For example, $100 displays as USD 100
  • If you have only one currency in your multi-currency organization, you can set a preference to display currency symbols instead of ISO codes: Go to “User Interface”, and then select “Show currency symbols instead of ISO codes”

To enable Multi-currency, you should:

  • In Setup, select Company Information and click Edit. Ensure that your selected currency locale is the default currency that you want to use for current and future records.
  • Check the checkbox “Allow Support to Activate Multiple Currencies”, and then save your changes.
  • Open a case with Salesforce support, and mention your Org. ID and your confirmation that you understand the implications of enabling multi-currency

When you enable Multi-Currency:

Single-Currency (default) Multi-Currency
  • SC: no “Manage Currencies”
  • MC: “Manage Currencies” setup menu appears under Company Profile
  • SC: no choice for default currency
  • MC: in User Settings, can choose your default Currency
  • SC: Currency symbols
  • MC: ISO code
  • MC: Currency Display Settings in User Interface (in case of 1 currency)
N/A
  • SC: no currency
  • MC: choose currency in new Product
  • SC: no opportunity currency field
  • MC: new Record Curremcy field on the record page – visible ONLY in Edit mode
  • The default currency takes the User’s default currency
  • If you are using another currency than your default, then the opportunity converts the amount to your default

Setup Currency:

  • Go to company Profile – Manage Currency:

  • Click on New. Enter the Currency, and the conversion rate.

(more…)

How to customize a Salesforce Dashboard Table

A table is one of the components that you can add to a Dashboard. It is not that much used, as Dashboards are intended to be “Graphical”. I had a requirement to add a table that displays 3 columns to a dashboard. First, I thought that should be easy, just do the report, then add a table to  dashboard with the created report as a source. I was wrong, as it is not that straight forward. Let me explain how I did it:

The table in the dashboard should display the top 10 Closed (Booked) opportunities with these columns: Account Name, Opportunity Name and Amount.

First, I created a standard report with the appropriate filter(s), that had the 3 columns I wanted listed in the dashboard:

 

Now, Let us try to add this report as a source to a table in a dashboard. Go to the Dashboard, add the Table component, and the Source report. Note the error we get! We need to add groupings in the report in order to be a valid source report to this Dashboard table component.

2016-10-21_1433      2016-10-21_1435      2016-10-21_1437

Now, let us try to add the Grouping and Summary to the report:

  • Account Name Group
  • Opportunity Name Group
  • Summarize by the Amount field (Sum)

We will get the 2 Groupings and the 1 Summary in the source report:

2016-10-21_1444

 

Back in the Dashboard:

2016-10-21_1447

2016-10-21_1448

(more…)

Welcome to SFDCnotes.com!

salesforce_certified_administrator Hello!

My name is Walid El Horr, I am a Systems Engineer ans Salesforce Admin, I just passed my Salesforce Administrator and Platform App Builder certifications in July 2016.

I started working with Salesforce as a customer: at the beginning of 2015, our company decided to use Salesforce and I was selected to be part of the team responsible of deciding-on and passing the salesforce_certified_platform_app_builderfunctional requirements to the Salesforce Consulting Partner. We had a lot of meetings and workshops with the Consulting Partner, it started with Webex calls to better align and understand the solution, and later on, bi-weekly workshops to tackle and agree on the requirements of specific Objects:

  1. Accounts and Contacts
  2. Opportunities (including Approvals)
  3.  Activities and Outlook Integration
  4. Case Management
  5. Reports and Dashboards
  6. Visibility
  7. Workflow Rules

After these Workshops, I had a much better understanding of Salesforce and its functionality, and the most amazing thing was that everything is on-demand in the Cloud. We can start with the out-of-box Sales Cloud functionality in literary just few days, we can start with only the required licenses and add more on the go!  I think this was the reason why Salesforce is the top CRM tool out there today. It was founded in 1999, without any support for on-premises model; this means that to use Salesforce, your only option was to use their subscription model and, again, this was in 1999, way before the cloud era where everything is “in the cloud”!

The next phase after the workshops and validating the requirements was the UAT (user acceptance testing). We were given 2-3 weeks to test the system and all what has been agreed-on during the Workshops.. To login, I was given a login ending with .uat, I did not know its reason until I took the Platform App Builder course.

The final phase was something called TTT… What on earth could TTT be? Train The Trainer! I was told that I was selected to train our staff (mostly Sales Reps) on how to use the system. This was music to my ears as I was already falling in love with Salesforce! We spent 3 full days working again on the concepts above, but this time going deeper. Of course, nothing too fancy there, it was just a training on how to use Salesforce and how to train the users later on, no Admin stuff here.

Salesforce Certified Administrator notes

During my preparation for the Admin  certification, I took tons of notes that I gathered from different excellent internet resources: Youtube videos, paid Udemy courses, paid independent courses, free blogs…etc. (all references will be listed) I started taking notes on Excel, then moved to Doc because it proved much more convenient as the notes were getting more detailed with tons of screenshots. Finally, after passing the Admin cert exam relying on these notes, I decided to share them for Free, and here comes SFDCnotes.com!

Let me know your feedback and feel free to contact me using the form on the Contact page.

Regards,
Walid
September 20, 2016