Why do we use plural forms when we are creating an object?

Plural form is for Tab name. If I create a tab for an object, it will take the plural form.




Cheers!!!

Objects supported in Force.com site

We can assign “Read” and “Create” permissions on all standard objects except products, price books, and ideas;

“Read,” “Create,” “Edit,” and “Delete” on all custom objects

Cheers!!!

How to remove chatter in Salesforce?

1. Go to Setup --> Customize --> Chatter --> Settings.


2. Disable chatter settings.


Cheers!!!

Simple SOQL to fetch records based on today's day and month in Salesforce

Sample Code:

        Date tody = system.today();
        String SOQL = 'SELECT Id, Name, Email__c FROM Employee__c WHERE DAY_IN_MONTH(Date_of_Birth__c) = ' + 
                      tody.day() +  ' AND CALENDAR_MONTH(Date_of_Birth__c) = ' + tody.month();

Cheers!!!

Simple Batch class for Birthday Notification

Sample Batch class:

global class BirthdayNotificationBatch Implements Database.Batchable <sObject> {
    global Database.queryLocator start(Database.BatchableContext bc) {
        Date tody = system.today();
        String SOQL = 'SELECT Id, Name, Email__c FROM Employee__c WHERE DAY_IN_MONTH(Date_of_Birth__c) = ' + 
                      tody.day() +  ' AND CALENDAR_MONTH(Date_of_Birth__c) = ' + tody.month();
        return Database.getQueryLocator(SOQL);
    }

    global void execute(Database.BatchableContext bc, List<Employee__c> listEmployee) {
        List<Messaging.SingleEmailMessage> mailList = new List<Messaging.SingleEmailMessage>();
        for(Employee__c m : listEmployee) {
            List<String> toAddresses = new List<String>{m.Email__c};           
            Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
            mail.setToAddresses(toAddresses);
            mail.setSubject('Happy Birthday');
            String messageBody = '<html><body>Hi ' + m.Name + ',<br/>Happy Birthday.<br/>Many More Happy '+
                                 'Returns of the day.<br/><br/><b>Regards,</b><br/>Admin</body></html>';
            mail.setHtmlBody(messageBody); 
            mailList.add(mail);          
        } 
        Messaging.sendEmail(mailList);        
    }

    global void finish(Database.BatchableContext bc) {
    }
}

Output:


Cheers!!!

How to send an email to people other than users using Workflow in Salesforce?

to send an email to people other than users using Workflow in Salesforce, add the email addresses in "Additional Emails" section.


Note:

You can enter up to five (5) email addresses to be notified.

Cheers!!!

Replace function in String using Apex in Salesforce

Sample Code:

String str = 'test';
system.Debug('Replace value is ' + str.replace('t','$').replace('e', '*').replace('s', '%'));

Output:


Cheers!!!

How to change the colors in the Dashboard in Salesforce?

As of now we can change the colors in the Dashboard in Salesforce only if the dashboards are displaying results based on the picklist field.

Sample Picklist field: City


Sample Dashboard:



Cheers!!!

How to restrict users to update closed Opportunity?

Sample Trigger:

trigger OpportunityTrigger on Opportunity (before update) {
    for(Opportunity oppty : trigger.new) {
        if(trigger.oldMap.get(oppty.Id).StageName == 'Closed Won') {
            oppty.addError('Closed Opportunity cannot be updated');
        }
    }
}

Cheers!!!

Chatter Groups

Chatter Groups:

Create public, private, and unlisted Chatter groups to collaborate with your teams and work together on projects.

Cheers!!!

How to remove time from date Salesforce?

format() will remove the time stamp from Date.

Sample Code:

Date dat = System.Today();
System.debug(dat.format());

Cheers!!!

How to add Opportunity Team Member related list in Salesforce?

1. Go to Setup --> Build --> Customize --> Opportunities --> Page Layouts.


2. Edit the page layout.


3. Select Related List.

4. Drag and Drop the "Opportunity Team" related list.


Cheers!!!

Where Quote pdfs are stored in Salesforce?

 Quote pdfs are stored QuoteDocument sObject in Salesforce.

Document attribute is used to store the binary data of the document stored in the QuoteDocument object.

Cheers!!!

How to bookmark a post in Salesforce?


Cheers!!!

How to enable knowledge side bar in Salesforce console?

1. Go to Setup --> Customize --> Cases --> Page Layouts.

2. Click Edit next to a page layout.

3. Click Layout Properties.

4. Check Knowledge Sidebar, and click OK.


5. Click Save.

Cheers!!!

How to fetch Custom Object tab using Apache ANT tool?

Sample Package.xml:

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>Listing__c</members>
        <name>CustomTab</name>
    </types>
<version>30.0</version>
</Package> 

CustomTab is also used for fetching Web Tab and Visualforce Tab.

Cheers!!!

Rendering based on Object access in Salesforce

$ObjectType.ObjectName.accessible - Check whether the user has access to the object.

$ObjectType.ObjectName.createable - Check whether the user has create access to the object.

$ObjectType.ObjectName.updateable - Check whether the user has update or edit access to the object.

$ObjectType.ObjectName.deletable - Check whether the user has delete access to the object.

Sample Code:

<apex:page >
<apex:form >
    <apex:pageBlock rendered="{!$ObjectType.Employee__c.accessible}">
        <!-- Code to show components that should be visible only to to users who has access to Employee object -->
    </apex:pageBlock>
    <apex:pageBlock rendered="{!$ObjectType.Employee__c.createable}">
        <!-- Code to show components that should be visible only to to users who has create access to Employee object -->
    </apex:pageBlock>
    <apex:pageBlock rendered="{!$ObjectType.Employee__c.updateable}">
        <!-- Code to show components that should be visible only to to users who has update access to Employee object -->
    </apex:pageBlock>
    <apex:pageBlock rendered="{!$ObjectType.Employee__c.deletable}">
        <!-- Code to show components that should be visible only to to users who has delete access to Employee object -->
    </apex:pageBlock>
</apex:form>
</apex:page>

Cheers!!!

How to set Assign using active assignment rules in Lead to true by default in Salesforce?

1. Go to the Laed page layout and edit it.

2. Click "Layout Properties" and set "Select by default" check box to true in Lead Assignment Checkbox.



Cheers!!!

How to set Assign using active assignment rules in Case to true by default in Salesforce?

1. Go to the Case page layout and edit it.

2. Click "Layout Properties" and set "Select by default" check box to true in Case Assignment Checkbox.



Cheers!!!

How to verify Salesforce certification?

1. Go to the below site

http://certification.salesforce.com/verification

2. Enter the Full Name or use the next search with Email.



3. Click "View Certifications".


Cheers!!!

How to get Session Id using Apex in Salesforce?

To get Session Id using Apex in Salesforce, UserInfo.getSessionId() is used.

Sample Code:

String sessionId = UserInfo.getSessionId().

Note: For Apex code that is executed asynchronously, such as @future methods, Batch Apex jobs, or scheduled Apex jobs, getSessionId returns null.

Cheers!!!

Validation for 10 digit phone number in Salesforce

Sample Validation:

OR( 
NOT( ISNUMBER( InfallibleTech__Phone__c ) ), 
NOT( REGEX( InfallibleTech__Phone__c , "[0-9]{10}") ) 
)


This validation is for for 10 digit phone number.

Cheers!!!

Footer right align in apex:pageBlockTable Salesforce

The CSS style float:right;, helps in Footer right align in apex:pageBlockTable.

Sample Code:

Visualforce page:

<apex:page docType="html-5.0" controller="Sample">
<apex:form >
    <apex:pageBlock >
        <apex:pageBlockTable value="{!listAccount}" var="a">
            <apex:column value="{!a.Name}"/>
            <apex:column value="{!a.AnnualRevenue}" style="text-align:right;">
                <apex:facet name="footer">
                    <apex:outputText value="${0, number, ###,###,###,##0.00}" style="float:right;">
                        <apex:param value="{!totalRevenue}" />
                    </apex:outputText>
                </apex:facet>
            </apex:column>
        </apex:pageBlockTable>
    </apex:pageBlock>
</apex:form>

</apex:page>

Controller:

public class Sample {
    public List<Account> listAccount {get;set;}
    public Double totalRevenue {get;set;}
    public Sample() {
        totalRevenue = 0;
        listAccount = [SELECT Name, AnnualRevenue FROM Account];
        calculateTotalRevenue();
    }
    private void calculateTotalRevenue() {
        for(Account acct : listAccount) {
            if(acct.AnnualRevenue != null)
                totalRevenue += acct.AnnualRevenue;
        }
    }
}

Output:



Cheers!!!

required field is missing : encoding key

We will get required field is missing : encoding key issue, when we are deploying without meta.xml file.

During deployment, include meta.xml file for that component.


Cheers!!!

Useful links for Salesforce Service Cloud Certification

http://www.proprofs.com/quiz-school/story.php?title=nncourage-con201-service-cloud-quiz-day1

http://www.proprofs.com/quiz-school/story.php?title=nncourage-con201-service-cloud-day2-quiz

http://quizlet.com/50298105/flashcards

http://quizlet.com/46430653/flashcards

http://quizlet.com/50292376/flashcards

http://www.cram.com/flashcards/salesforce-service-cloud-sample-questions-5267818

http://www.guoyinfeng.info/2014/01/19/example-questionaire-for-service-cloud-consultant/

http://quizlet.com/18704995/service-cloud-certification-study-flash-cards/

http://www.flashcardexchange.com/cards/sfdc-service-cloud-flashcards-1-16-2012-2047507

http://www.flashcardmachine.com/salesforce-service-cloudmec.html

http://www.flashcardmachine.com/salesforce-service-cloudpartiimec.html

http://www.flashcardexchange.com/cards/sfdc-service-cloud-flashcards-1-16-2012-2047507

http://www.cram.com/cards/sfdc-service-cloud-flashcards-1-16-2012-2047507

http://quizlet.com/24160406/service-cloud-consultant-exam-3-flash-cards/

http://ajanya.com/index.php/sfde-service-cloud-consultant-questions-3

http://certifiedondemand.com/service-cloud-quiz/

http://quizlet.com/15364773/service-cloud-certification-study-flash-cards/

http://www.opfocus.com/2013/05/keys-to-becoming-salesforce-service-cloud-consultant-certified/

http://www.cram.com/cards/sfdc-service-cloud-flashcards-1-16-2012-2047507

http://quizlet.com/15364773/service-cloud-certification-study-flash-cards/

http://quizlet.com/25274554/flashcards

Cheers!!!

Trigger to restrict attachment Size restriction in Salesforce

Sample Trigger:

trigger AttachmentBIUTrigger on Attachment (before insert, before update) {
for(Attachment att : trigger.new) {
if(att.Body.size() > 3145728) {
att.addError('Size cannot be greater than 3 MB');

}
}

Cheers!!!

How to add logo in Letter Head in Salesforce?

1. Go to All tabs.


2. Select Document tab.


3. Click "New".


4. Click "Save".


5. Go to Setup --> Administer --> Letterheads.


6. Click "New Letterhead".


7. Save the letter head.


8. Click "Select Logo".


9. Select the logo.


Output:


Cheers!!!

Call Deflection

The practice of guiding customers to use other channels than the phone to solve customer service issues.

Cheers!!!

Option expected SVN issue

Option expected SVN issue occurs whenever we edit the Server.conf file.

To fix this issue, check the Server.conf file has any extra spaces.

Cheers!!!

apex:detail in Apex in Salesforce

Sample Code:

Visualforce page:

<apex:page controller="Sample">
    <apex:form >
        <h1>Below is the Account detail</h1>
        <apex:detail subject="{!AccountId}" relatedList="false"/>
    </apex:form>

</apex:page>

Apex Controller:

public class Sample {
    public Id AccountId {get;set;}
 
    public Sample() {
        AccountId = '0019000001BoVNx';
    }
}

Output:



Cheers!!!

How to get Salesforce organization id using apex?

Sample Code:

Id OrgId = UserInfo.getOrganizationId();

Cheers!!!

Duplicate_Value: duplicate value found when building unique index

Duplicate_Value: duplicate value found when building unique index is due to setting a field Unique and that field has duplicate values in the existing records.

Whenever a field is set to Unique, Salesforce will index that field. During that time, if duplicate values are found on that object, we will face this issue.

Cheers!!!

Request Timed out issue in Tortoise SVN

To fix Request Timed out issue in Tortoise SVN, set the proxy settings.

To set the proxy settings, use the below steps.

1. Go to C:\Users\username\AppData\Roaming\Subversion\servers

Note: here username is your currently logged in user name.

2. Set http-proxy-host and http-proxy-port.


Cheers!!!

Live Agent not showing in console app issue

1. Go to My Settings.


2. Go Advanced User details.


3. Enable Live Agent User check box.


Cheers!!!

Data and File Storage Limits in Salesforce

Limits for storage allocation per Salesforce edition and number of users in your organization.

Storage is divided into two categories:

1. File storage
2. Data storage.

File storage includes files in attachments, the Documents tab, the Files tab, the File field, Salesforce CRM Content, Chatter (including user photos), and Site.com assets.

Data storage includes the following:
Accounts
Article types (format: “[Article Type Name]”)
Article type translations (format: “[Article Type Name] Version”)
Campaigns
Campaign Members
Cases
Case Teams
Contacts
Contracts
Custom objects
Email messages
Events
Forecast items
Google docs
Ideas
Leads
Notes
Opportunities
Opportunity Splits
Orders
Quotes
Quote Template Rich Text Data
Solutions
Tags: Tag applications
Tags: Unique tags
Tasks

For file storage, Contact Manager, Group, Professional, Enterprise, Performance, and Unlimited Editions are allocated a per-user limit multiplied by the number of users in the organization plus an additional per-organization allocation. For example, an Enterprise Edition organization with 600 users receives 1,211 GB of file storage, or 2 GB per user multiplied by 600 users plus an additional 11 GB. A Professional Edition organization with 600 users receives about 370 GB of file storage, or 612 MB per user multiplied by 600 users plus an additional 11 GB.

For data storage, Contact Manager, Group, Professional, Enterprise, Performance, and Unlimited Editions are allocated either 1 GB or a per-user limit, whichever is greater. For example, a Professional Edition organization with 10 users receives 1 GB because 10 users multiplied by 20 MB per user is 200 MB, which is less than the 1 GB minimum. A Professional Edition organization with 100 users receives more than the 1 GB minimum because 100 users multiplied by 20 MB per user is 2,000 MB.

File storage and data storage are calculated asynchronously, so your organization’s storage usage isn’t updated immediately if you import or add a large number of records or files.

Salesforce Edition
Data Storage Minimum Per Organization
Data Storage Allocation Per User License
File Storage Allocation Per Organization
File Storage Allocation Per User License
Contact Manager
1 GB
20 MB
11 GB
612 MB
Group
1 GB
20 MB
11 GB
612 MB
Professional
1 GB
20 MB
11 GB
612 MB
Enterprise
1 GB
20 MB
11 GB
2 GB
Performance
1 GB
120 MB
11 GB
2 GB
Unlimited
1 GB
120 MB
11 GB
2 GB
Developer
5 MB
N/A
20 MB
N/A
Personal
20 MB (approximately 10,000 records)
N/A
20 MB
N/A

Cheers!!!

How to create custom fields in Custom object in Salesforce?

1. Go to Setup --> Build --> Create Objects.


2. Select the object.



3. Click "New" Button under Custom Fields and Relationship section.



Cheers!!!

How to create Objects in Salesforce?

1. Go to Setup --> Build --> Create Objects.


2. Click "New Custom Object" button.


Cheers!!!

escape attribute in Salesforce

A Boolean value that specifies whether sensitive HTML and XML characters should be escaped in the HTML output generated by this component. If you do not specify escape="false", the character escape sequence displays as written. Be aware that setting this value to "false" may be a security risk because it allows arbitrary content, including JavaScript, that could be used in a malicious manner.

For example, the only way to add a ">" symbol to a label is by using the symbol's character escape sequence and setting escape="false". If you do not specify escape="false", the character escape sequence displays as written.

Sample Code:

Visualforce page:

<apex:page controller="Sample">
    <apex:form >
        <apex:pageBlock >
            <apex:pageBlockSection >
                <apex:pageBlockSectionItem >Enter Text:</apex:pageBlockSectionItem>
                <apex:pageBlockSectionItem ><apex:inputText value="{!str}"/></apex:pageBlockSectionItem>
            </apex:pageBlockSection>
            <apex:pageBlockButtons >
                <apex:commandButton value="Show"/>
            </apex:pageBlockButtons>
        </apex:pageBlock>
        <apex:pageBlock >
            <apex:outputLabel escape="true" value="Escape true : {!str}"/><br/>
            <apex:outputLabel escape="false" value="Escape false : {!str}"/>
        </apex:pageBlock>
    </apex:form>
</apex:page>

Apex Class:

public class Sample {
    public String str {get;set;}
    
    public Sample() {
    }
}

Output:



 

Cheers!!!