Tuesday, April 30, 2019

 Certification Guide

How to get certified
Salesforce Administrator 201 Certification

Salesforce is one of the fastest growing and most in-demand skills in IT right now, and to add that knowledge to your resume can have a payoff almost immediately. The Salesforce ecosystem extends far past its original cloud-based CRM platform, so Salesforce technical skills prove extremely useful and necessary in a wide range of areas, from system administrators, to product managers, developers, integration architects and beyond.

Becoming Salesforce Certi fied is not only a highly effective way to prove your skills are current and at the expected baseline level but more often than not a prerequisite for companies who seek Salesforce experts. Most Salesforce-related jobs will require a minimum of one certi cation, and the entry-level – but no less challenging – is the Salesforce Certi ed Administrator certi cation.

One thing I hear a lot from people with multiple Salesforce certifications is that passing the Certi ed Administrator exam was one of the hardest. Why? Well, because it’s the rst one and the material covered is very comprehensive. So although this is a prerequisite exam to several other certi cation paths, it’s not one you can simply show up and take the test without preparation, even if you’ve worked with Salesforce for years.

Don’t let the dif culty level of the test put you off, though. The good news is that it doesn’t matter whether you’re already an experienced system administrator who wants to take the next step and get certi ed, or if you come from a completely different background and decided to learn a new set of skills from scratch. Getting that rst certi cation can be achieved in a few months, even if this is the rst time you’re reading the word “Salesforce”. You just need to devise a plan, prepare and practice.

I passed the Salesforce Certi ed Administrator exam exactly 3 months after I started studying for it. Before that, my Salesforce knowledge was very limited, to say the least. But with that goal in mind, I also wanted to pass the rst time I took the test. Ambitious? Maybe, but very feasible as I later found out.

There are different ways you can prepare for the exam. Salesforce University runs courses onsite or online, one of them being the Administration Essentials for New Admins (Admin201), which can run you about $4500 for the 3-day course. You read that gure correctly. So if you or the company you work for are not willing to make that investment on your certi cation goals, there are many self-study resources online that can help you prepare for the exam. I took the second option which proved to be highly rewarding and I plan on using those same resources for my future certi cation exams.


What to expect from the exam?

Understanding the format of this test will help you structure the way you study for it.
There are 60 multiple-choice questions (plus 5 unscored questions) and 105 minutes to complete.

65% is the passing score, which means you need 39 correct answers.

You may take the test at a test centre, or remotely on your own computer. The second option is monitored through a webcam and you must submit your biometrics and follow strict guidelines beforehand, but may be worth it if you don’t have a test centre near
you or need more exibility in terms of scheduling. You can nd the information about scheduling your exam and the guidelines here.

The fee to take the test is $200 and the retake fee is $100.

Every question is worth 1 mark on the test. Some questions will ask you to pick more than one correct answer but you either get the whole point or nothing. There’s no partial marks for a multi-select question.
The questions on the exam are scenario based. Some questions are longer than others.

You can mark questions for review on your screen during the test, and that’s a tool I highly recommend using so you can maximize your ef ciency during the test.
When taking the test, if you know the answer to a question right away, don’t dwell on it or second-guess yourself. Pick your answer and move on. Likewise, if you don’t know the answer, mark for review and come back to it later so you have time to answer the ones you know.
Use all the allotted time given on the test and read each question carefully, while always being mindful of the clock. I recommend spending 70 minutes on the 60 questions, allowing yourself the remaining 20 minutes for questions marked for review. So if you see yourself spending over 1 minute per question, it may be time to move quicker.
Some of the multiple choice options will have made-up names for things such as a “List” Report Format, which doesn’t exist or is not one of the report formats in Salesforce. You can eliminate those options easily right off the bat.
None of the exams are open-book so you may not bring any notes, hardcopy material or take notes with you during the exam. Before 2017, Salesforce would only give you “Pass” or “Fail” results at the end of your exam. Now, they are including Section-Level Feedback Results, shown as a percentage of correct answers from each topic on the exam, as outlined on the exam guide. It’s great feedback because it shows you exactly what your strong points are or areas you could practice more, in case you fail.
Once you pass, you’ll receive an email with your test results, a link to your certifi cate as well as a link to the of cial “Salesforce Certi ed” badge that you can add to your pro le photos on LinkedIn, social media, or pretty much anywhere you would like to brag about! You’ll also be invited to the exclusive Salesforce Certifi ed Success Community.
Your certi fication may be displayed on their offi cial veri fication website, which you can opt in or out before you take the exam (or after if you change your mind).


Some very important topics to focus on:

Standard & Custom Objects 15%

Sales & Marketing Applications 15%

Security & Access 14%

Monday, April 29, 2019

What is difference between insert and database.insert in salesforce apex

DML Statements vs. Database Class Methods
Apex offers two ways to perform DML operations: using DML statements or Database class methods. This provides flexibility in how you perform data operations. DML statements are more straightforward to use and result in exceptions that you can handle in your code. This is an example of a DML statement to insert a new record.
// Create the list of sObjects to insert
List<Account> acctList = new List<Account>();
acctList.add(new Account(Name='Acme1'));
acctList.add(new Account(Name='Acme2'));

// DML statement
insert acctList;
This is an equivalent example to the previous one but it uses a method of the Database class instead of the DML verb.
// Create the list of sObjects to insert
List<Account> acctList = new List<Account>();
acctList.add(new Account(Name='Acme1'));
acctList.add(new Account(Name='Acme2'));

// DML statement
Database.SaveResult[] sr = Database.insert(acctList, false);

// Iterate through each returned result
for (Database.SaveResult sr : srList) {
    if (sr.isSuccess()) {
        // Operation was successful, so get the ID of the record that was processed
        System.debug('Successfully inserted account. Account ID: ' + sr.getId());
    }
    else {
        // Operation failed, so get all errors               
        
for(Database.Error err : sr.getErrors()) {
            System.debug('The following error has occurred.');                   
            System.debug(err.getStatusCode() + ': ' + err.getMessage());
            System.debug('Account fields that affected this error: ' + err.getFields());
        }
    }
}
One difference between the two options is that by using the Database class method, you can specify whether or not to allow for partial record processing if errors are encountered. You can do so by passing an additional second Boolean parameter. If you specify false for this parameter and if a record fails, the remainder of DML operations can still succeed. Also, instead of exceptions, a result object array (or one result object if only one sObject was passed in) is returned containing the status of each operation and any errors encountered. By default, this optional parameter is true, which means that if at least one sObject can’t be processed, all remaining sObjects won’t and an exception will be thrown for the record that causes a failure.
The following helps you decide when you want to use DML statements or Database class methods.
·       Use DML statements if you want any error that occurs during bulk DML processing to be thrown as an Apex exception that immediately interrupts control flow (by using try. . .catch blocks). This behavior is similar to the way exceptions are handled in most database procedural languages.
·       Use Database class methods if you want to allow partial success of a bulk DML operation—if a record fails, the remainder of the DML operation can still succeed. Your application can then inspect the rejected records and possibly retry the operation. When using this form, you can write code that never throws DML exception errors. Instead, your code can use the appropriate results array to judge success or failure. Note that Database methods also include a syntax that supports thrown exceptions, similar to DML statements.
Note
https://www.salesforce.com/us/developer/docs/apexcode/Content/images/img/help/helpNote_icon.gifMost operations overlap between the two, except for a few.
·      The convertLead operation is only available as a Database class method, not as a DML statement.
The Database class also provides methods not available as DML statements, such as methods transaction control 

What are trigger context variables in salesforce

salesforce lightning,
Variable
Usage
isExecuting
Returns true if the current context for the Apex code is a trigger, not a Visualforce page, a Web service, or an executeanonymous() API call.
isInsert
Returns true if this trigger was fired due to an insert operation, from the Salesforce user interface, Apex, or the API.
isUpdate
Returns true if this trigger was fired due to an update operation, from the Salesforce user interface, Apex, or the API.
isDelete
Returns true if this trigger was fired due to a delete operation, from the Salesforce user interface, Apex, or the API.
isBefore
Returns true if this trigger was fired before any record was saved.
isAfter
Returns true if this trigger was fired after all records were saved.
isUndelete
Returns true if this trigger was fired after a record is recovered from the Recycle Bin (that is, after an undelete operation from the Salesforce user interface, Apex, or the API.)
new
Returns a list of the new versions of the sObject records.
Note that this sObject list is only available in insert and update triggers, and the records can only be modified in before triggers.
newMap
A map of IDs to the new versions of the sObject records.
Note that this map is only available in before update, after insert, and after update triggers.
old
Returns a list of the old versions of the sObject records.
Note that this sObject list is only available in update and delete triggers.
oldMap
A map of IDs to the old versions of the sObject records.
Note that this map is only available in update and delete triggers.
size
The total number of records in a trigger invocation, both old and new.


Price Book Entry Fields

Field
Description
Active
Whether the price book entry (product and list price) is active and can be added to an opportunity or quote.
Created By
The name of the user who created the price book entry, including the date and time of creation.
Currency
This field is available only for Salesforce orgs with multiple currencies enabled and represents the currency to use for the price book entry (product and list price).
Last Modified By
The name of the user who last saved the price book entry record.
List Price
The price of the product within the price book, including currency.
Price Book
The price book that contains the price for this entry.
Product
The product’s name.
Product Code
The internal code or product number that’s used to identify the product.
Standard Price
The standard price for the product. This field is derived and doesn’t exist on the underlying PricebookEntry standard object.
Use Standard Price
Whether the p


What is difference between soap and rest api


Difference between SOAP and REST APIs
SOAP API
REST API
Simple Object Access Protocol
Representational State Transfer
It is based on standard XML format
It is based on URI
It works with WSDL
It works with GET, POST, PUT, DELETE
Works over with HTTP, HTTPS, SMTP, XMPP
Works over with HTTP and HTTPS


How to create extension controller for visual force page and get url params


get current record id salesforce
Visualforce Page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<apex:page standardController="Account" extensions="CurrentRecordIdDemoController">
  <apex:form >
    <apex:pageBlock >
        <apex:pageBlockSection title="Current account record Id is : {!currentRecordId}" collapsible="false">
            <apex:outputField value="{!acc.name}"/>
            <apex:outputField value="{!acc.AccountNumber}"/>
            <apex:outputField value="{!acc.Type}"/>
            <apex:outputField value="{!acc.Industry}"/>
        </apex:pageBlockSection>
         
        <apex:pageBlockSection title="Testing parameter" collapsible="false">
            Name is <b>{!parameterValue}</b>
        </apex:pageBlockSection>
         
    </apex:pageBlock>
  </apex:form>
</apex:page>
Apex Code:
1
2
3
4
5
6
7
8
9
10
11
public class CurrentRecordIdDemoController{
public String currentRecordId {get;set;}
public String parameterValue {get;set;}
public Account acc{get;set;}

    public CurrentRecordIdDemoController(ApexPages.StandardController controller) {
        currentRecordId  = ApexPages.CurrentPage().getparameters().get('id');
        acc = [select id ,name, AccountNumber, Type, Industry from
 Account where id =: currentRecordId ];
        parameterValue = ApexPages.CurrentPage().getparameters().
get('nameParam');
    }
}