Friday, June 10, 2016

Salesforce Tutorial

Welcome to Salesforce Tutorial

This tutorial helps you to understand basic concepts of Salesforce. Now Salesforce.com is a number one on demand CRM in the market. It runs on the force.com platform, it reduces development cost and we can deliver application in very short time.

– It is a cloud computing technology. It is available on cloud, no need install any software and no hardware required.
– You can develop our own applications or if you need any application on demand, you can buy from app exchange.
– App Exchange is a market place to sell our custom applications and to buy applications from app exchange.

One of the main advantage of  sfdc is upgrading the features three times per year. Every year sfdc provide three releases called winter, Spring and Summer. These releases won’t impact your existing functionality. And salesforce provide many new features with each release.

About Salesforce.com(SFDC) 


Salesforce.com is a global Cloud Computing headquarter in San Francisco,California.Through best known for its Customer Relationship Management(CRM).As of early 2016, it is one of the most highly valued American cloud computing companies with a Market capitalization above $55 billion,although the company has never turned a GAAP profit in any fiscal year since its inception in 1999.Revenue is 6.667 billion USD (2016).

History
The Company was founded in 1999 by former Oracle executive Marc Benioff, Parker Harris , Dave Moellenhoff as a Company specialising in Software as a Service(Saas).
In June 2004 ,the Company went public on the New York Stock Exchange under the stock symbol CRM.
Infrastructure & Operations
Salesforce.com migrated to Dell servers with AMD processors running Linux from Sun Fire E25K servers with SPARC processors running Solaris in 2008. The company uses the Momentum platform from Message Systems to allow its customers to send large amounts of email without encountering deliverability problems.
In 2012, Salesforce.com announced plans to build a Data Center in the UK to handle European citizens' personal data.
In 2013, Salesforce.com and Oracle announced a 9-year partnership in which Salesforce.com will use Oracle Linux, Oracle ExaData, Oracle DataBase, and the Java platform to power salesforce.com's applications and SaaS platform.

Salesforce Vs. The Competition :A CRM Primer
Salesforce.com is a leader in providing cloud-based enterprise software applications and platform services. How does it stack up to the competition? Here's how.
 Salesforce.com's customer-relationship management (CRM) systems enable its customers to track, manage, analyze, and share information about sales opportunities, leads, and ongoing processing, and even make forecasts about sales.
Although at age 16 Salesforce.com is younger than SAP, Oracle, Microsoft, and some other major players offering CRM solutions, it's sitting on top of the sector. The latest report from Gartner indicates that Salesforce.com leads worldwide CRM software vendors with 18.4% marketshare in 2014, compared to No. 2 SAP, with 12.1% marketshare. Salesforce.com also had the highest revenue growth (28.2%) from 2013 to 2014, versus No. 2 Microsoft with 21.7% growth.
Salesforce categorizes its products under various cloud-based offerings, including Sales Cloud, Service Cloud, Marketing Cloud, Community Cloud, and Analytics Cloud. Its solutions are customizable and can be tailored to meet a business' particular requirements.

Delivery Model

Salesforce.com is only delivered as software-as-a-service (SaaS), which means customers do not need to buy, install, update, or maintain dedicated hardware or software for it. However, there is no option available for using this software within a private cloud or on-premises environment.
Other big players in CRM offer both on-premises and cloud-based CRM solutions: Oracle has Oracle-CRM On-Demand and Oracle Siebel CRM, SAP has SAP CRM Systems suite and SAP CRM On-Demand, and Microsoft offers Microsoft Dynamics CRM 2013 and Dynamics CRM Online.

Marketshare And Target Customer Size



In terms of marketshare, Salesforce.com is the market leader with 18.4% marketshare, followed by SAP (12.1%), Oracle (9.1%), Microsoft (6.2%), and IBM (3.8%).
Salesforce.com does not target any specific customer segment and retains a diversified customer base. Its "Group" and "Professional" editions suffice for small and midsize organizations, while "Enterprise" and "Unlimited" editions can meet the needs of large organizations and multinational enterprises.
Salesforce faces steep competition in all market segments. For enterprise customers, it competes with Oracle, Microsoft, and SAP. At the midrange it faces Sage CRM, GoldMine, and RightNow. In the small-business market Salesforce goes head-to-head with Zoho, Nimble, Highrise, Insight.ly, and more.

Reporting And Analysis

Salesforce.com offers customizable reports and dashboards that empower sales managers and executives with instant access to real-time data and analysis. Support for multiple ready-to-use analysis scenarios, such as sales pipeline analysis, win-loss analysis, and historical trend analysis, is backed up with real-time views of sales data, enabling managers to instantly access the information they need to complete a sales and marketing report. A few advanced features such as territory management and predictive forecasts help in preparing estimates based on revenues, quantities, or geographies.
Microsoft Dynamics CRM is backed by the rigid SQL Server Reporting Services engine for report generation. SAP CRM has interactive reporting capabilities, which enable users to perform ad-hoc analysis in real time. Oracle CRM provides the ability to generate reports without much need for technical knowledge.

Licensing And Pricing

Salesforce.com automation and CRM products can be procured on a per-user subscription basis and are billed annually, which is more or less similar to the cloud-based offerings from all other vendors. Starting at $25 per user per month (for the Group edition), Salesforce.com licenses rise as high as $250 per user per month (for the Unlimited edition).
In terms of revenue growth, from 2013 to 2014 Salesforce grew the fastest among all the primary CRM competitors, with a pace of 28.2% growth in worldwide revenue, followed by Microsoft (21.7%), other companies (11.5%), IBM (10.2%), SAP (7.2%), and Oracle (2.6%).

Create and Email a PDF with Salesforce.com

PdfEmailer Visualforce Page
The Visualforce page simply allows the user to enter their email address and select a sample Account from the picklist. This is Account that is passed to the PdfGeneratorTemplate Visualforce page to generate the PDF.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<apex:page controller="PdfEmailController">
  <apex:sectionHeader title="PDF Example" subtitle="Email a PDF" 
    description="Example of how to email a dynamically generated PDF."/>
 
  <apex:form >
    <apex:pageMessages />
    <apex:pageBlock title="PDF Input">
 
      <apex:pageBlockButtons >
        <apex:commandButton action="{!sendPdf}" value="Send PDF"/>
      </apex:pageBlockButtons>
 
      <apex:pageBlockSection >
 
        <apex:pageBlockSectionItem >
            <apex:outputLabel value="Email to send to" for="email"/>
          <apex:inputText value="{!email}" id="email"/>
        </apex:pageBlockSectionItem>
 
        <apex:pageBlockSectionItem >
            <apex:outputLabel value="Account" for="account"/>
            <apex:selectList value="{!accountId}" id="account" size="1">
                 <apex:selectOptions value="{!accounts}"/>
            </apex:selectList>
        </apex:pageBlockSectionItem>
 
      </apex:pageBlockSection>
 
    </apex:pageBlock>
  </apex:form>
 
</apex:page>
PdfEmailerController
The Controller passes the Account ID that the user entered as a parameter for the Visualforce page being generated. It let creates the attachment from the PDF content. The Body of the attachment uses the Blob returned from the PageReference’s getContent method. You could also use the getContentAsPDF method which always returns the page as a PDF, regardless of the component’s renderAs attribute. However, this method always seems to throw an error in the test class. See the PageReference documentation for more info. The method then constructs the SimpleEmailMessage object and then sends it on its way to the recipient’s inbox.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
public with sharing class PdfEmailController {
 
  public ID accountId {get;set;}
  public String email {get;set;}
 
  public List<SelectOption> accounts {
    get {
      if (accounts == null) {
        accounts = new List<SelectOption>();
        accounts.add(new SelectOption('0017000000LgRMb','United Oil & Gas Corp.'));
        accounts.add(new SelectOption('0017000000LgRMV','Burlington Textiles Corp of America'));
      }
      return accounts;
    }
    set;
  }
 
  public PageReference sendPdf() {
 
    PageReference pdf = Page.PdfGeneratorTemplate;
    // add parent id to the parameters for standardcontroller
    pdf.getParameters().put('id',accountId);
 
    // the contents of the attachment from the pdf
    Blob body;
 
    try {
 
      // returns the output of the page as a PDF
      body = pdf.getContent();
 
    // need to pass unit test -- current bug  
    } catch (VisualforceException e) {
      body = Blob.valueOf('Some Text');
    }
 
    Messaging.EmailFileAttachment attach = new Messaging.EmailFileAttachment();
    attach.setContentType('application/pdf');
    attach.setFileName('testPdf.pdf');
    attach.setInline(false);
    attach.Body = body;
 
    Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
    mail.setUseSignature(false);
    mail.setToAddresses(new String[] { email });
    mail.setSubject('PDF Email Demo');
    mail.setHtmlBody('Here is the email you requested! Check the attachment!');
    mail.setFileAttachments(new Messaging.EmailFileAttachment[] { attach }); 
 
    // Send the email
    Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
 
    ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.INFO, 'Email with PDF sent to '+email));
 
    return null;
 
  }
 
}
PdfGeneratorTemplate Visualforce Page
This is the Visualforce page that is generated in the Controller. It simply uses the StandardController and displays the Account name for the ID passed to it.
1
2
3
4
<apex:page standardController="Account" renderAs="pdf">
  <h1>Congratulations!!</h1>
  <p>You created a PDF for {!account.name}</p>
</apex:page>
Test Class
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
@isTest
private class Test_PdfEmailController {
 
  static Account account;
 
  static {
 
    account = new Account();
    account.Name = 'Test Account';
    insert account;
 
  }
 
  static testMethod void testPdfEmailer() {
 
    PageReference pref = Page.PdfEmailer;
    pref.getParameters().put('id',account.id);
    Test.setCurrentPage(pref);
 
    PdfEmailController con = new PdfEmailController();    
 
    Test.startTest();
 
    System.assertEquals(2,con.accounts.size());
 
    // populate the field with values
    con.accountId = account.id;
    con.email = 'test@noemail.com';
    // submit the record
    pref = con.sendPdf();
 
    Test.stopTest(); 
 
  }
}

Batch Apex using Querylocator and iterable

Common interview questions for Salesforce developers

Name three Governor Limits .                                                                                    Description Synchronous ...