Saturday, December 17, 2016

Salesforce Platform Developer - I Certification Tips


I have cleared another Salesforce Certification yesterday - It's Platform Developer - I. In this post, I am going to share my study notes. Hopefully it will help others as well.

If you are an experienced developer or admin having more than 6 months of experience, it is very easy to clear this certification. But if you are new to Salesforce, then I think this study note is going to help you. I found 50% - 60% questions are scenario based.

During the exam, I am sure you will get multiple questions which will make you confuse in terms of more than one correct answers. My suggestion is that read the question/scenario 2-3 times, there will be one/two words which will lead to the correct answer. If you still not able to find the correct answer, mark the question for review and go to the next question. Don't spend too much time in one question.

Note - Don't treat this as a Certification dumps. Rather the intention of the post is to share my strategy, topics I covered during my preparation.

Another important point to mention here is that when I gave this certification the release from Salesforce was Winter'17. With every release, Salesforce brings new features so you need to go through the release notes as well.

Let's start by topics mentioned in the Certification Syllabus. 
  1. Salesforce Fundamentals [Weighting: 10% i.e. # of Questions: 6]
    • Describe the considerations when developing in a multi-tenant environment
      • Study Guide:
      • Notes:
        • Keep tenant-specific data secure in a shared database so that one tenant can't see another tenant's data.
        • Customize various schema objects and an application's user interface in real time without affecting the functionality or availability of the system for all other tenants.
        • Can the system's code base be patched or upgraded without breaking tenant-specific schemas?
        • Will the system's response time scale as tens of thousands of tenants use the service?
    • Describe how the Salesforce platform features map to the MVC pattern
      • Study Guide:
      • Notes:
    • Describe the capabilities of the core CRM objects in the Salesforce schema
    • Identify the common scenarios for extending an application's capabilities using the AppExchange
    • Given a scenario, identify common use cases for declarative customization
      • Study Guide:
        • Scenario based question which will focus on test takers ability to identify whether to use formula, roll-up summary field, validation rule, workflow rule, process builder or approval process. Refer trailhead modules ‘process automation’ and ‘formula fields and validations’
      • Notes:
  2. Data Modeling and Management [Weighting: 12% i.e. # of Questions: ~8]
  3. Logic and Process Automation [Weighting: 46% i.e. # of Questions: ~28]
    • Describe how to programmatically access and utilize the object schema.
    • Describe the capabilities and use cases for formula fields.
      • Study Guide:
      • Order of execution:
        • Formula fields are executed/evaluated at access time, be it through VF page or API or Apex.
      • Formula Field Limitations:
        • The value of Formula field can’t depend on another formula field.
        • You can’t delete fields which is getting referenced in formula field.
        • You can’t use long text area, encrypted, or Description fields in formulas.
        • Default value formulas for a record type can only reference fields for that record type.
        • However formula fields and formulas for approval, validation rule can access fields from that object as well any object which are associated with that object either through lookup or master-detail relationship.
      • Formula Field Data Types:
        • Checkbox
        • Currency
        • Date
        • Date/Time
        • Number
        • Percent
        • Text
      • Cross-Object Formula Fields:
        • Cross-Object formula works with master-detail as well as lookup relationship. You need to make sure cross-object formula field is on the detail side of the master-detail relationship.
        • Cross-Object formula can reference fields from objects that are upto 10 relationships away.
        • Cross-Object formula referencing Currency field converts the currency value as per the record where the formula field is added.
        • However is the currency field is from a custom settings, then the value will not be converted.
        • Salesforce allows a maximum 10 unique relationships per object in cross-object formulas.
        • You can’t reference cross-object formulas in roll-up summary fields.
        • In cross-object formulas, you can’t reference merge fields for objects related to Activities. For example, merge fields for Account and Contact are not available in cross-object formulas in Task and Event object.
        • Important - While creating formula field, if you are referencing fields from an object where you don’t have read access, you will still be able to see the information. For example - If in the Case object, you are creating a formula field which is referencing fields from Account object and you don’t have read/view permission on Account object, you will still be able to see the information in Case page layout.
        • Important - Cross-Object formula is all about getting information of Parent object in Child object. So in the exam, if you are getting questions where you need to fetch child information in parent record, then it should be roll-up summary field.
    • Describe the capabilities and use cases for roll-up summary fields.
      • Study Guide:
      • Roll-Up Summary Field:
        • Roll-Up Summary Field works only the master-detail relationship.
        • Roll-Up Summary Field should be set in the master object.
        • When you delete a record in the detail side, Salesforce doesn’t recalculate the value of Roll-Up Summary field. Select the option Force a mass recalculation on this field on the edit page of the roll-up summary field to manually recalculate  the value.
        • Auto number fields are not available for aggregate in roll-up summary field.
        • Once you have created Roll-Up summary field, you can’t change the relationship to Lookup.
        • Changes to the value of Roll-Up summary field can trigger assignment rules to run.
        • A Roll-Up summary field can trigger workflow rules and field validations.
        • If your organization is having multiple currency, then currency on the master record will determine the currency of the roll-up summary field.
        • Salesforce will not allow updating/saving related records if it is violating validation rule on Roll-Up Summary field.
        • Fields that user cannot see due to FLS on the detail record are still calculated in a roll-up summary field.
        • Roll-up summary field is not available in the edit page. So they can’t be used as error location for your validation.
    • Describe the capabilities of the declarative process automation features.
      • Study Guide:
      • Notes:
        • If there is a situation where you need to choose between Process Builder and Workflow, you should always select Process Builder as Process Builder supersedes Workflow.
        • Workflow can update only parent fields in cross-object update whereas Process Builder can update either parent or child.
        • The only thing which you can do with Workflow, but not with Process Builder is send outbound messages without code. However, you can work around this limitation by calling Apex code from a Process Builder.
        • If the process is too complex for Process Builder, you should always go for Visual Workflow.
        • If you need to get information from customer, then Visual Workflow should be your solution approach. Based on the information received from user, write your logic to perform multiple logics.
        • Where approval is required, you need to go for Approval Process.
        • Check the below picture for capabilities -  https://trailhead.salesforce.com/business_process_automation/process_whichtool
    • Describe when to use declarative automation features vs. Apex classes and triggers
    • Describe how to declare variables and constants in Apex and how to assign values using expressions. 
    • Describe the primitive and complex Apex data types and when to use them.
      • Study Guides:
        • Topic should be covered by the above link
      • Notes:
    • Describe how to use and apply Apex control flow Statements.
      • Study Guides:
      • Notes:
        • Need to understand the difference between SOQL For Loops versus Standard SOQL Queries.
        • Standard SOQL Query can retrieve count as well number of sObject records.
        • SOQL For Loops always retrieve all sObjects using efficient chunking with calls to the query and queryMore methods of the SOAP API.
        • Developer should always use SOQL For Loop when handling with many records just to make sure they are not getting hit by the heap size limit.
        • Queries including an aggregate function don’t support queryMore.
        • SOQL For Loop can process records one at a time using a single sObject variable or in batches of 200 sObjects at a time using an sObject list. It is recommended to to go for batch option when you want to use DML statements within the for loop body.
        • Using inline SOQL query within SOQL For Loops can throw QueryException with the message “Aggregate query has too many rows for direct assignment, use For Loop”. This exception is thrown when accessing large number of child records(200 or more) of a retrieved sObject inside the For loop. To avoid such exception, we need to use a for loop to iterate over the child records and not to use inline SOQL query.
    • Describe how to write and when to use Apex classes and interfaces.
      • Study Guides:
      • Notes:
        • Inner class can’t have Static Variables. Only top-level class(outer class) variables can be declared static.
        • Inner class behaves like a static Java Inner class, but it doesn’t required the Static keyword. An inner class can have instance variables like an outer class, but there is no implicit pointer to an instance of the outer class(using the this keyword). So to access outer class variables inside inner class, you need to pass the reference of outer class to inner class by passing the this.
        • The private access modifier is the default.
        • The public access modifier means methods and variables can be used by any Apex in this application or namespace.
        • The global  access modifier means methods and variables can be used by any Apex that has access to the class, not just the apex code in the same application. If you are writing methods for SOAP API or if your method is going to be accessed by other Apex code, you should mark your method as global. global  methods can only be put inside a global class.
        • Methods and classes are final by default.
          • The virtual  keyword allows extension and override.
          • The override keyword must be used to override the base class.
        • Interface methods are always global.
        • Classes and Interfaces can be defined in triggers and anonymous block, bit only as local.
    • Describe how to use basic SOSL, SOQL, and DML statements when working with objects in Apex.
      • Study Guides:
      • Notes:
        • Upsert will either create the new record or update the existing record. It will find the existing record based on the specified field to match. If nothing mentioned, it will match based on the ID value.
        • Merge  will merge upto three records of the same sObject type into one of the record, deleting the others and reparenting any related records.
        • You can retrieve all the fields including ID field for one sObject record, but you can’t do that with DML statements. You need to write SOQL for that.
        • DML Limit: 150 statements per Apex transaction.
        • For upsert, you can select any field which is marked as External ID for Custom Object. For Standard Object, you can select any field which has idLookup property set to true. For example - Email field of Contact or user has idLookup property set to true. So you can use those fields in upsert operation to match the existing record.
        • For upsert, the logic -
          • If key is not matched, new record will be created.
          • If key is matched, existing record will be updated.
          • If key is matched with multiple records, an error is generated and the object is neither inserted nor updated.
        • Delete will delete the record and place it in recycle bin for 15 days.
      • DML Exception:
        • If a DML statement failed, it returns an exception of type DmlException.
      • DML Exception:
        • Database methods have an optional allOrNone parameter that allows you to specify whether the operation should partially succeed.
          • allOrNone = false: Successful records will be committed and errors will be returned for the failed records. Also, no exceptions are thrown here.
          • allOrNone = true: This is the default value. Database methods behave like DML statements and will throw an exception if a failure is encountered.
        • Database.insert() -> Database.SaveResult[]
        • Database.upsert() -> Database.UpsertResult[]
        • Database.delete() -> Database.DeleteResult[]
      • Should we use DML Statements or Database Methods?
        • Use DML Statements if you want any errors which may occur during bulk DML operation should be reported back as an Apex exception and as a developer, you can take control of the errors by using try-catch block and stop the execution immediately.
        • Use Database methods if you want to allow partial success of bulk DML operation i.e. even if few of records failed, you want rest of the records to go ahead and succeed. Using this approach, you can stop sending Apex exception and you as a developer take care of the failed record separately through code.
    • Describe the basic patterns used in triggers and classes to process data efficiently.
    • Describe when to use and how to write triggers.
      • Study Guides:
      • Notes:
        • If a trigger was invoked due to DML operation from Apex, any one error will make the entire operation rolls back. However, the runtime engine will still process every record in the operation context to compile a comprehensive list of errors.
        • If a trigger was invoked due to bulk DML call/operation, runtime engine sets aside the bad records and attempts to do a partial save of the records that did not generate errors.
        • If a trigger ever throws an unhandled exception, all the records are marked with an error and no further processing takes place.
        • Trigger.new and Trigger.old can’t be used the DML operations.
        • You can’t delete trigger.new
      • Trigger and Merge Statements:
        • Merge events do not fire their own trigger event. Rather they fire delete and update events -        
          • Delete Event: A Single merge operation fires a single delete event for all losing records.When a record is deleted after losing in the merge operation, MasterRecordId field is set to the ID of the winning record. The MasterRecordId field is only set in after delete context.  
          • Update Event: A single merge operation fires a single update event for the winning record only. Any child records that are reparented as a result of merge operation do not fire triggers.
          • Following is the order of events when a merge occurs:
            • The before delete trigger occurs.
            • The system deleted the necessary records due to merge, assign new parent records to the child records, and sets the MasterRecordId field on the deleted records.
            • The after delete trigger fires.
            • The system perform the updates required for the master record. Normal update trigger happens.
      • Triggers and Recovered Objects:
        • The after undelete trigger event only works with recovered objects - i.e. the records that were deleted and then recovered from the Recycle Bin through the undelete DML statements.
        • The after undelete trigger runs only on the top-level objects. For example, if you delete an Account, an Opportunity which is associated with that Account will also get deleted. Now if you undelete the same Account from Recycle Bin, the associated Opportunity records will also be undeleted. But undelete trigger will only execute for Account, not for Opportunity.
      • Order of Execution:
    • Describe the implications of governor limits on Apex transactions.
    • Describe the relationship between Apex transactions, the save execution order, and the potential for recursion and/or cascading
    • Describe how to implement exception handling in Apex
      • Study Guides:
      • Notes:
        • List of Built-In Exceptions -
          • DmlException: Any problem with DML statements like insert statement missing a required field.
          • ListException: Any problem with List such as attempting to access an index that is out of bounds.
          • NullPointerException: No need the explain. World Famous Exception.
          • QueryException: Any problem with SOQL Queries, such as assigning a query that returns no records or more than one record to a singleton sObject variable.
          • SObjectException: Any problem with sObject records, such as attempting to change a field in an update statement that can only be changed during insert.
        • Common Exception Methods -
          • getCause
          • getLineNumber
          • getMessage
          • getStackTraceString
          • getTypeName
          • getDmlFieldNames(Index of the failed record): Returns the name of the fields that caused the error for that particular record.
          • getDmlId(Index of the failed record): Returns the ID of the failed record.
          • getDmlMessage(Index of the failed record): Returns the error message for the specified failed record.
          • getNumDml: Returns number of failed records.
    • Describe how to write Visualforce Controller 
    • Describe when and how to use Standard Visualforce Controllers vs. Apex Custom Controllers and controller extensions.
    • Describe the programmatic techniques to prevent security vulnerabilities in Apex and Visualforce.
    • Describe how Apex impacts the ability to make declarative changes.
  4. User Interface [Weighting: 10% i.e. # of Questions: 6]
  5. Testing [Weighting: 12% i.e. # of Questions: ~8]
  6. Debug and Deployment Tools [Weighting: 10% i.e. # of Questions: 6]
                                 


  • Important Topics:
    • Apex Controller, Controller Extensions and Custom Controller
      • Custom Controller and Controller Extensions run in System Mode. In order to make sure that Custom Controller and Controller Extensions respects user’s owd, role hierarchy and sharing settings, you need to mark them with with sharing keyword.
      • If a Controller Extension extends a Standard Controller, the logic from Standard Controller will execute in User mode i.e. it will respect OWD, role hierarchy and sharing settings.
      • A Visualforce Page can have one Standard Controller, but more than one Controller Extension classes.
      • Controllers are attached to the page using any of the below three mutually exclusive formats -
        • Standard Controller
        • Standard Set/List Controller
        • Custom Controller
      • You can’t do -
        • DML Operation in Constructor or getter/setter methods
        • @future method call from Constructor or getter/setter methods.
    • Standard Set Controller
      • ApexPages.StandardController encapsulates a single object
      • ApexPages.StandardSetController contains a list of records (one or more), and has additional methods to support pagination and update multiple records at the same time.
      • Instantiate a StandardSetController in two ways -
      • From a list of sObjects:
                  List allAccounts = [SELECT ID, Name FROM Account LIMIT 200];
ApexPages.StandardSetController ctrl = new ApexPages.StandardSetController(allAccounts)

From Query Locator:
ApexPages.StandardSetController ctrl = new ApexPages.StandardSetController(Database.getQueryLocator([SELECT ID, Name FROM Account]));
      • The maximum record limit for SetController is 10,000 records.
      • When Initializing a StandardSetController with Query Locator and if Query Locator is returning more than 10,000 records, LimitException will be thrown.
      • When Initializing a StandardSetController with list of sObjects and if the list contains more than 10,000 records, no exception will be thrown. Rather it will truncate the records to the limit.
    • Page Reference
      • PageReference is a reference to instantiate a page.
      • Use PageReference for -
        • To view and set query String parameters and their values for the page
        • To navigate to a difference page as a rest of an action method
      • You can instantiate a page in below different ways -
        • Page.existingPageName where existingPageName is the VF Page Name
        • PageReference pageRef = new PageReference(‘*** PARTIAL URL ***’); Here PARTIAL URL /apex/HelloWorld refers to https:///apex/HelloWorld.
        • PageReference pageRef = new PageReference(‘*** FULL URL ***’);
        • PageReference pageRef = new PageReference(‘https://www.sudipta-deb.blogspot.com’);
        • PageReference pageRef = ApexPages.currentPage();
      • To navigate to a new page, make setRedirect(true);
    • Components we can’t deploy with Metadata API:

I hope this post will provide you the guidance to clear Platform Developer - I. Provide me your feedbacks and please share with greater audience if you think it is helpful. Please let me know if you have any queries. 

Finally Wishing You BEST OF LUCK. 

0 comments:

Post a Comment