Lead- What is Lead|Lead Management

What is Lead?



We can define Leads in many ways. It is a potential customer/potential Sales contact/potential Sales opportunity. It may be an individual or a company that shows interest on your products/goods/services.




How leads are generate? Leads are generated in many ways like from existing customer, referrals, through web, through online advertisements, TV advertisements, online advertisements, Campaigns and directs customers. Sales reps will follow up with leads and they convert lead as an opportunity. To convert lead as an opportunity some criteria is required based on company.




Lead

Salesforce CRM has applications like Marketing, Sales & Service application. Lead Management is one of the key functionality to improve business. As part of marketing cloud Campaign Management & Lead Management functionalities help customers to get more leads and to get more sales. Lead is one of the standard object provided by Salesforce and this object having attributes like Name, Industry, Status, Owner, Campaign, Company, Address and Annual Revenue.



Lead status will change based on their interest. Status like Open-Not Contacted, Working-Contacted, Closed-Converted and Closed-not converted and also customers can create their own status based on their needs.

What will happen after conversion? Once lead is eligible for conversion, we can convert lead as an opportunity. After conversion account, contact and opportunity are created. If the account & contact are existed, only opportunity will create.





Marketing Campaign|What is Campaign?

Marketing Campaign




Campaign

Marketing Campaign, In Salesforce CRM, Marketing management is one of the key functionality to get more business. As part of standard of functionality, Salesforce providing Campaign custom object to track campaigns and this object has properties like Name, Active, Type, Status, Start date, end date, Expected Revenue, Budget and we can add more properties based on our needs.




What is Campaign? All of us know about this term as this is the starting step to get success in your business, not only in business, if you see politics, Campaign is the first step to promote their party/Candidate.

Nowadays, each and every company (small/medium/large/ Extra Large) is conducting campaigns to achieve their goals in business. The main purpose of this campaign is to get more leads. If you get more leads, you may get more business. Leads may come from many ways, through campaigns, through referrals, through online etc… You can easily promote your product using this.




There are different type of campaigns like public meetings, TV advertisements, online advertisements, Banners advertisements, phone advertisements (call/message), and email advertisements. The purpose of each and every type to promote business, to get leads and to get more profits.

How companies will target to promote their products/services? Companies target existing customers, new customers, Existing leads and new leads.
Is every one can create Campaigns? No, the users having “marketing user” permission enabled at user level and based on their profile permissions users can create, edit or delete.



To enable user permission login to your Salesforce org, go to user detail page and enable “Marketing user” permission. See the below image for reference.

Marketing Campaign





Apex Trigger Events|Apex Trigger Exaples

Trigger Examples:



What is Trigger? Trigger is piece of code that is executes before and after a record is Inserted/Updated/Deleted from the force.com database.




Trigger Events: Before Insert, Before Update, Before Delete, After Insert, After Update, After Delete and after undelete.




Example 1:
trigger trigEventsTest on Department__c (before insert,after insert,before update,after update) {
if(Trigger.isInsert)
{
system.debug(‘***IsINSERT*****’);
}
if(Trigger.isUpdate)
{
system.debug(‘******IsUpdate*****’);
}
if(Trigger.isBefore && Trigger.isInsert)
{
system.debug(‘****IsBefore and IsInsert*****’);
}
if(Trigger.isAfter && Trigger.isInsert)
{
system.debug(‘*******IsAfter and IsInsert*****’);
}
if(Trigger.isBefore && Trigger.isUpdate)
{
system.debug(‘*****Before Update******’);
}
}



Example 2:
Account with Multiple Contacts:
trigger Con5Insert on Account (after insert) {
if(Trigger.isAfter)
{
system.debug(‘****New Account Record is ******’+Trigger.new);
Contact objContact ;
List<Contact> lstcon = new List<Contact>();
for(Integer i=1;i<=5;i++)
{
objContact = new Contact(lastname=’AAAAAAAAA’+string.valueof(i),AccountId=Trigger.new[0].Id);
lstcon.add(objContact);
}
system.debug(‘****List Of Contacts *****’+lstcon.size());
insert lstCon;
} }

Example 3:
Trigger.new and Trigger.old
trigger trigEventsTest on Department__c (before update,after update) {
If(Trigger.new[0].name != Trigger.new[0].name)
{
system.debug(‘*****Value Changed******’);
}
else
{
system.debug(‘*****Value did not change******’);
}
}

Example 4:
Add Error:
trigger trigEventsTest on Department__c (before insert) {
if(Trigger.new[0].name==’India’)
{
Trigger.new[0].name.addError(‘Name should not be India’);
}
}




Salesforce Security related updates – winter 16

Salesforce new Security features – Security and Identity




Security

– Log in look and feel – Salesforce has redesigned and improves salesforce login user experience in winter 16 release. This feature is available in both Lightning Experience & Salesforce classic.




– Salesforce has improved safety for Unwanted login attempts. This feature is availablein all editions.

– Now, we can track the geographic locations of the IP addresses for any user form user detail page.

– Transition security policies – to learn about security issues.

– Safety is improved for Unwanted login attempts: Salesforce added measures to prevent.

– We can customize error messages, if error occurred during SSO using an authentication provider.

– Easy way to reorder applications. user interface is improved to arrange the default sort order for salesforce, custom & connected apps in your salesforce org.








Running Specified Tests-Changeset deployment

Running specified test classes with Changeset deployment



Running specified tests option is now available with change set deployment in Salesforce. This option is available with winter 16 release. We can choose which tests to run when deploying or validating inbound changeset in Sandbox org production orgs. This option is available in both Salesforce Classic & Salesforce Lightning Experience.




Below running test option are available when you validate/deploy an inbound changeset:

Default, Run Local Tests, Run All Tests & Run specified Tests.




Default: By default no test classes will execute in a sandbox & all local tests will run when your inbound change set contains apex classes/apex triggers.

Run Local Tests: All local  test classes will  run with this option(Excludes managed packages classes).

Run All Tests: All test classes will  execute including managed packages.

Run Specified Tests: Only specified test classes will run with this option. We have to provide specified tests in comma-separated list.

This option is available with winter 16 release.




Lightning Experience – Winter 16 updates

Lightning Experience – Reports & dashboard features




Lightning Experience features:

–  Salesforce has redesigned Reports & Dashboard homepage in Winter 16 release to provide rich user interface to users.
– New rich editor to create dashboards.
– Interactive dashboards to present & share information.
– New features on report run page to get more information from interactive chats & filters.

Above features are available in  Lightning Experience only.




New Names for Reporting Products and Features in winter 16 release:

– Salesforce1 Reporting is now called Salesforce Reports and Dashboards.
– Salesforce1 Reporting API via Apex is now called Salesforce Reports and Dashboards API via Apex.
– Salesforce1 Reporting REST API is now called Salesforce Reports and Dashboards REST API.




See here for more information




Update records owned by inactive users

How to Update records owned by inactive users during data migration




Migrating bulk data from one organization to other organization is very difficult as migrating data owned by inactive users is difficult. We have activate & inactivate to migrate such type of data. This really very difficult task to migrate huge data and time we may have to face licensing issues to activate users.




Finally this task is going to easier for us as Salesforce is providing a feature in Winter 16 upgrade.  Salesforce has placed this feature behind an organization preference called “Enable Set Audit Fields upon Record Creation and Update Records with Inactive Owners.”




Hope we can see this feature in Sandboxes on September 11th.





Setup Audit fields feature – Winter 16 release update

Setup Audit fields




What is audit fields feature? This feature allow us to migrate created date, last modified date, created by & last modified by fields data.




Many of us know about setup audit fields in salesforce. In Salesforce data migration we cannot migrate some fields data directly like created date & Last modified by fields data. To migrate this data we need to contact salesforce.com support to enable audit fields.

With the Winter 16 Salesforce release, we can directly enable this feature without contacting Salesforce.




To enable the user permissions, first enable the organization preference on the User Interface page. From Setup, enter User Interface in the Quick Find box, then select User Interface. After you enable the organization preference, enable the user permissions in a permission set or profile. You can set audit fields only in API-enabled editions of Salesforce.





SObjectType Example

SObjectType Example: How to Retrieving the list of Salesforce objects from the Org?




SObjectType Example: Here is the example to get all Salesforce objects in a picklist values from any Salesforce org.




Visualforce page:

<apex:page sidebar="false" controller="DObjDisplay">
<apex:form > 
ObjectNames: 
<apex:selectlist multiselect="false" size="1">
<apex:selectOptions value="{!objNames}">
</apex:selectOptions>
</apex:selectlist>
</apex:form>
</apex:page>

Apex Class:

public with sharing class DObjDisplay {
Map<String, Schema.SObjectType> gd = Schema.getGlobalDescribe();
public List<SelectOption> getobjNames()
{
List<Schema.SObjectType> gd = Schema.getGlobalDescribe().Values();
List<SelectOption> options = new List<SelectOption>();
for(Schema.SObjectType f : gd)
{
options.add(new SelectOption(f.getDescribe().getName(),f.getDescribe().getName()));
}
return options;
}
}

Schema class Contains methods for obtaining schema describe information.




Here the visualforce page o/p preview:

SObjectType Example

 


Input field & output field Examples

<apex:inputfield> and <apex:outputfield>




Example 1: Difference between <apex:inputfield> and <apex:outputfield>
<apex:page sidebar=”false” standardController=”account”>
<apex:form >
<apex:pageBlock >
<apex:pageBlockSection >
<apex:outputfield value=”{!account.name}”> </apex:outputfield>
<apex:inputfield value=”{!account.phone}”></apex:inputfield>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>



Example 2: Placing input fields without using standard controller:
TO place any input field you have to create a property for that object in apex class.
So that you can use that property name with in input field to place the input component.
page:
<apex:page Controller=”ContactClass” sidebar=”false”>
<apex:form >
<apex:pageBlock >
<apex:pageBlockSection >
<apex:inputfield value=”{!con1.lastname}”/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
class:
public with sharing class ContactClass {
public Contact con1{get;set;}
}



Example 3: Action function to populate the Address Fields:
In this scenario whenever we select an account from a contact
automatically the address fields are copied from account to contact.
page:
<apex:page standardController=”Contact” extensions=”ContactClass” sidebar=”false”>
<apex:form >
<apex:actionFunction name=”populatefields” action=”{!dopop}”/>
<apex:pageBlock >
<apex:pageBlockSection columns=”1″>
<apex:inputfield value=”{!con1.AccountId}” onchange=”populatefields()”/>
<apex:inputfield value=”{!con1.Mailingcity}”/>
<apex:inputfield value=”{!con1.Mailingcountry}”/>
<apex:inputfield value=”{!con1.Mailingpostalcode}”/>
<apex:inputfield value=”{!con1.Mailingstate}”/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
class:
public with sharing class ContactClass {
public ContactClass(ApexPages.StandardController controller) {
con1 =(contact)controller.getRecord();
}
public PageReference dopop() {
Account objAcc =[select Id,name,Billingcity,Billingcountry,billingstate,billingpostalcode from Account where Id =:con1.AccountId ];
con1.Mailingcity=objAcc.billingcity;
con1.mailingcountry = objAcc.billingcountry;
con1.mailingpostalcode = objAcc.billingpostalcode;
con1.mailingstate = objAcc.billingstate;
return null;
}
public Contact con1{get;set;}
}