December 31, 2014
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!!!
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!!!
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!!!
December 30, 2014
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!!!
Schema.DescribeSObjectResult r = Directory_Edition__c.sObjectType.getDescribe();
String URLforObj = URL.getSalesforceBaseUrl().toExternalForm() + r.getKeyPrefix() + '/o';
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.
2. Microsoft IE 7 and IE 8 are less secure.
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!!!
December 29, 2014
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!!!
<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!!!
String baseURL = URL.getSalesforceBaseUrl().toExternalForm();
Cheers!!!
December 27, 2014
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.
3. User permissions cannot be included.
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.
December 26, 2014
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!!!
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!!!
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!!!
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!!!
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!!!
December 24, 2014
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!!!
Sample Code:
String str1 = ' test ';
String str2 = str1.trim(); //test will be output without any white spaces
Cheers!!!
December 23, 2014
Salesforce study link
Below is the best link for getting started with Salesforce
https://developer.salesforce.com/trailhead
Cheers!!!
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!!!
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!!!
December 22, 2014
December 19, 2014
December 18, 2014
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!!!
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!!!
December 17, 2014
December 15, 2014
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!!!
<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!!!
December 12, 2014
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!!!
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!!!
December 11, 2014
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!!!
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!!!
December 10, 2014
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!!!
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!!!
December 9, 2014
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!!!
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!!!
December 4, 2014
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!!!
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
With USING SCOPE:
Without USING SCOPE:
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
With USING SCOPE:
Without USING SCOPE:
Subscribe to:
Posts (Atom)