How to avoid duplicates while importing Custom Objects records in Salesforce?

1. Go to Setup --> Administer --> Data Management --> Import Custom Objects.


2. Select Yes under Do you want to prevent duplicates from being created?


Cheers!!!

How to avoid duplicates while importing Leads in Salesforce?

1. Go to Setup --> Administer --> Data Management --> Import Leads.


2. Select Matching type for avoiding duplicates.


Cheers!!!

How to avoid duplicates while importing Solutions in Salesforce?

1. Go to Setup --> Administer --> Data Management --> Import Solutions.


2. Select Yes under Do you want to prevent duplicates from being created?


Cheers!!!

How to avoid duplicates while importing Accounts or Contacts in Salesforce?

1. Go to Setup --> Administer --> Data Management --> Import Accounts/Contacts.


2. Select Matching type for avoiding duplicates.


Cheers!!!

How to rename related list in Salesforce custom relationship?

1. If the child object is a custom object: From Setup, go to Create > Objects > (Name of Object).
    If the child object is a standard object: From Setup, go to Customize > (Name of Object) > fields.

2. Locate the custom lookup or master-detail field referencing the parent object.

3. Click the "Edit" link next to the relationship field.


4. Rename the "Related List Label".

5. Remember to "Save" when finished.


Cheers!!!

How to rename related list in Salesforce standard relationship?

1. From Setup, go to Customize > Tab Names and Labels > Rename Tabs and Labels.

2. Click the "Edit" link next to the name of the child object.


3. Rename the Singular and Plural labels.

Note: Plural label is used to title related lists

4. Remember to "Save" when finished.

Check the below link for renaming tabs and labels.

http://www.infallibletechie.com/2013/08/how-to-rename-standard-fields-labels-in.html

Cheers!!!

How to get the URL for the object tab in Salesforce?

Sample Code:

        Schema.DescribeSObjectResult r = Directory_Edition__c.sObjectType.getDescribe();
        String URLforObj = URL.getSalesforceBaseUrl().toExternalForm() + r.getKeyPrefix() + '/o';

Cheers!!!

How to find what browser was used by the users for Salesforce login?

To find the browsers used by the users for Salesforce login, go to Setup --> Administer --> Manage Users --> Login History.


Cheers!!!

Microsoft IE 7 and IE 8 for Salesforce

Starting from Summer '15, Salesforce will end their support for Microsoft IE 7 and IE 8 for Salesforce.

After Summer '15, new features will no longer work in these features.

Why Microsoft IE 7 and IE 8 will not be supported?

1. Microsoft IE 7 and IE 8 is not HTML5 compatible.

2. Microsoft IE 7 and IE 8 are less secure.

Cheers!!!

How to call apex method on enter key press in Salesforce?

Sample Code:

<apex:page>

<script type='text/javascript'>
    function noenter(ev)  {
        if (window.event && window.event.keyCode == 13 || ev.which == 13) {
            callAcctRet();
            return false;
         } else {
              return true;
         }
     }
</script>

<apex:form>
    <apex:actionFunction action="{!retToAcct}" name="callAcctRet"/>
    <apex:inputText value="{!firstName}" onkeypress="return noenter(event);"/>
    <apex:form>
</apex:page>

Cheers!!!

How to get Salesforce URL using Apex?

Sample Code:

String baseURL = URL.getSalesforceBaseUrl().toExternalForm();

Cheers!!!

How to assign a Permission Set to Multiple Users

1. Go to Setup --> Manage Users and select Permission Sets.

2. Open a Permission Set.

3. Click "Add Assignments".

4. Select the users.

5. Click "Assign" button.

Note: You can select only upto 1000 users at a time.

Permission Set limitations in Salesforce

1. You can create only up to 1,000 permission sets.

2. Permission Set is used only for granting access. It cannot be used for revoking access.

3. User permissions cannot be included.

4. We can't assign permission to a custom object in a master detail relationship where master is a standard object.

Trigger to create an attachment and attach it along with the record in Salesforce

Sample Trigger:

trigger sendEmail on Employee__c (after insert)  {    
    List<Attachment> listAttachments = new List<Attachment>();
    for(Employee__c e : trigger.new) {   
        Attachment a = new Attachment();
        a.ParentId = e.Id;
        a.Name = e.Name + Date.Today();
        a.ContentType = 'text/plain';
        a.Body = Blob.valueOf(e.Name + ' is added successfully');
        listAttachments.add(a);
    }
    insert listAttachments;
}

Cheers!!!

OpportunityLineItem

OpportunityLineItem is the junction object between Opportunity and Product objects.


Cheers!!!

How to change the fields used by Hover Details in Salesforce?

Mini Pagelayout in Salesforce allows you to choose the fields and related lists that will display in the mini view of the console.

You can define mini page layouts for the records that appear in the mini view of the Agent console, hover details, and event overlays. A mini page layout contains a subset of the items in an existing page layout. Mini page layouts inherit record type and profile associations, related lists, fields, and field access settings from their associated page layout. The visible fields and related lists of the mini page layout can be further customized, but the other items inherited from the associated page layout cannot be changed on the mini page layout itself.


Cheers!!!

Mini Pagelayout in Salesforce

Mini Pagelayout in Salesforce allows you to choose the fields and related lists that will display in the mini view of the console.

You can define mini page layouts for the records that appear in the mini view of the Agent console, hover details, and event overlays. A mini page layout contains a subset of the items in an existing page layout. Mini page layouts inherit record type and profile associations, related lists, fields, and field access settings from their associated page layout. The visible fields and related lists of the mini page layout can be further customized, but the other items inherited from the associated page layout cannot be changed on the mini page layout itself.


Cheers!!!

How to remove leading or trailing white space characters using Apex in Salesforce?

To remove leading or trailing white space characters using Apex in Salesforce, trim() is used.

Sample Code:

String str1 = ' test   ';
String str2 = str1.trim(); //test will be output without any white spaces

Cheers!!!

Salesforce study link

Below is the best link for getting started with Salesforce

https://developer.salesforce.com/trailhead

Cheers!!!

Case Management in Salesforce

 Case management enables you to make the most of each interaction and become a true champion of customer success. Automating the distribution of cases in your service organization ensures that each customer inquiry automatically and immediately gets to the right group or agent and has the quickest and most accurate resolution. Because every organization is different, you can customize Salesforce to meet your unique business processes.

Salesforce provides the below featues

1. Suggested Solution.
2. Case Contact Roles.
3. Case Comment Notification
4. Assignment Rule.
5. Auto Response Rule.
6. Escalation Rule.
7. Case Queue.
8. Web to Case.
9. Email to Case.

Cheers!!!

How to override Standard button or link in Salesforce?

1. Go to the object's buttons and links section and click edit to the button to be overridden.



2. Select the Visualforce page to be opened when the button is clicked.


Cheers!!!

How to check the login histories of all the users in Salesforce?

To check the login histories of all the users in Salesforce, go to Setup --> Administer --> Manage Users --> Login History.



Cheers!!!

How to allow deployment when apex classes are scheduled in Salesforce?

1. Go to Deployment Settings.



2. Enable the below check box and Save it.


Cheers!!!

How to check whether a string is numeric using Apex in Salesforce?

Example:

String str = '45f6';
if(str.isNumeric()) {
   // Sinces str is not numeric, it never enters into this loop
}


Example:

String str = '456';
if(str.isNumeric()) {
   // Sinces str is numeric, it enters into this loop
}

Cheers!!!

How to set chat capacity to the users in Live Agent in Salesforce?

1. Go to Setup --> Build --> Customize --> Live Agent --> Live Agent Configurations.



2. Create a Live Agent Configuration and assign it to the user by selecting user or the profile.


Cheers!!!

Save and New feature using Apex in Salesforce

Visualforce page:

<apex:page standardController="Contact" extensions="Sample">
<apex:form >
    <apex:pageBlock >
        <apex:pageBlockButtons >
            <apex:commandButton value="Save" action="{!save}"/>
            <apex:commandButton value="Save & New" action="{!saveAndNew}"/>
            <apex:commandButton value="Cancel" action="{!cancel}"/>
        </apex:pageBlockButtons>
            <apex:pageBlockSection >
                <apex:inputField value="{!Contact.FirstName}"/>
                <apex:inputField value="{!Contact.LastName}"/>
                <apex:inputField value="{!Contact.Email}"/>
            </apex:pageBlockSection>
    </apex:pageBlock>
</apex:form>
</apex:page>

Apex Class:

public class Sample {
    ApexPages.StandardController sController;
    public Sample(ApexPages.StandardController controller) {
        sController = controller;
    }

    public PageReference saveAndNew() {
        sController.save(); 
        PageReference pg = new PageReference('/apex/Sample');
        pg.setRedirect(true);
        return pg;
    }
}

Cheers!!!

How to merge PDF files online?

To merge PDF files online, check the below link

http://www.pdfmerge.com/


Cheers!!!

Error: Record Currently Unavailable in Salesforce

If you face "Error: Record Currently Unavailable" issue while saving a Visualforce page, kindly use the below soloution.

1. Enable Development Mod check box in user details.

http://www.infallibletechie.com/2012/11/how-to-enable-developer-mode-in.html

2. Open the Visualforce page.

3. In the editor below, update your page.

Note:
Error: Record Currently Unavailable occurs in many situations. The above solution is only for Visuaflorce page update.

Cheers!!!

How to add attachments of Lead to Account while we convert the Lead in Salesforce?

Sample Trigger:

trigger LeadTrigger on Lead (after update) {
    List<Attachment> listAttachments = new List<Attachment>();
    List<Attachment> listInsertAttachments = new List<Attachment>();
    set<Id> leadIds = new set<Id>();
    
    for(Lead l : trigger.new) {
        if(l.isConverted) {
            leadIds.add(l.Id);
        }
    }
    
    if(leadIds.size() > 0) {
        listAttachments = [SELECT Name, Body, ParentId FROM Attachment WHERE ParentId IN: leadIds];
        
        if(listAttachments.size() > 0) {
            for(Attachment a : listAttachments ) {
                Attachment newAttachment = a.clone();
                newAttachment.ParentId = trigger.newMap.get(a.ParentId).ConvertedAccountId;
                listInsertAttachments.add(newAttachment);
            }
            
            insert listInsertAttachments;
        }
    }
}


Cheers!!!

How to map lead fields to Account, Contact and Opportunity while converting leads in Salesforce?

1. Go to Setup --> Customize --> Leads --> Fields.

2. Click "Map Lead Fields" button.


3. After mapping, click "Save" button.


Cheers!!!

How to enable and disable global header(menu for communities)?

1. Open the user's profile.

2. Select "System Permissions".



3. Enable or disable "View Global Header" check box to enable and disable global header.


Cheers!!!

Salesforce Knowledge

Salesforce Knowledge is a knowledge base where users can easily create and manage content, known as articles, and quickly find and view the articles they need. After you set up Salesforce Knowledge in your organization, users can write, edit, publish, and archive articles using the Articles Management tab or find and view published articles using the Articles tab. Customers and partners can access articles if Salesforce Knowledge is enabled in the Customer Portal or partner portal. You can also create a public knowledge base so website visitors can view articles.

Articles capture information about your company's products and services that you want to make available in your knowledge base.

Note:
To implement Salesforce Knowledge at least one Article Type should be present.

Implementation:

1. Go to My Settings.


2. Check Knowledge User check box is checked. If it is not enabled, edit it and enable it.



3. Go to Setup --> Customize --> Knowlede --> Article Types.


4. Click "New Article Type" button.


5. Enter the details and click "Save" button.


6.  Go to Setup --> Customize --> Knowlede --> Settings.


7. Enable Knowledge.



8. Go to all tabs and select "Article Management" tab.


9. Click "New".


10. Enter the details and click "Ok".


11. Enter the details and click "Save & Close".


12. Select the Article and publish it.


13. Go to Customize --> Cases --> Pagelayouts.


14. Edit the pagelayout.


15. Drag and drop Articles related list.


16. Go to Case tab.


17. Click "New".


18. Save the Case.


19. Click "Find Articles".


20. Find and attach the article.


Output:


To know about Data Category which is the next step in Salesforce Knowledge, use the below link

http://www.infallibletechie.com/2015/06/data-categories-in-salesforce-knowledge.html

Cheers!!!

Dynamic Approval process in Salesforce

Dyanamic Appoval basically to allocate the Approver dynamically. Dynamic approval process is used to route approval requests to users listed in lookup fields on the record requiring approval. In this, approver names are defined dynamically from an object.

Implementation:

1. Create a lookup field to user in your object. Let the name be Next_Approver__c.

2. Write a logic to assign the approval to the user mentioned in that field using setNextApproverIds().

Check the below link for sample code for the step 2.

http://www.infallibletechie.com/2012/04/approval-process-using-apex.html

Cheers!!!

What is Profile in Salesforce?

Profile is a collection of Settings and Permissions which determines

1. What users can see on the UI

2. What functionality users can access

3. What records users can view, edit and delete

Settings determine what users can see, for example, apps, tabs, fields, and record types. Permissions determine what users can do, for example, create or edit records of a certain type, run reports, and customize the app.


Cheers!!!

USING SCOPE clause for SOQL

The new USING SCOPE clause for SOQL queries lets you limit results by filterScope.

Syntax:

SELECT column_name FROM table_name USING SCOPE filterScope_value

filterScope_value can take one of the following enumeration values: Everything, Mine, Queue, Delegated, MyTerritory, MyTeamTerritory or Team.


Example:

SELECT Name FROM Account USING SCOPE Everything

Cheers!!!

Solution Categories in Salesforce

1. Go to Setup --> Build --> Customize --> Solutions --> Solution Categories.


2. Add a Solution Category by clicking "Add Solution Category".


3. Save the Solution Category.


4. Go to Setup --> Build --> Customize --> Solutions --> Solution Settings.


5. Make sure "Enable Solution Browsing" check box is enabled.


6. Go to Solution Pagelayout and edit it to add the Solution Categories related list.


7. Open a Solution and click "Select Categories" to add categories.


8. Click "Select" link next to Category name to select it.


9. Save the selected categories by clicking "Save" button.


10. Go to Solutions tab to view it.


Cheers!!!