The component is not using the 'DisplayCaseController' Apex controller

Use the below code:

Controller Code:

({
    getCase: function(cmp){
        var action = cmp.get("c.getCaseFromId");
        action.setCallback(this, function(response){
            var state = response.getState();
            if (state === "SUCCESS") {
                cmp.set("v.record", response.getReturnValue());
            }
        });
$A.enqueueAction(action);
    }
})

Component Code:

<aura:component controller="DisplayCaseController">
<aura:attribute name="record" type="Case"/>
    <ui:button label="Get Case" press="{!c.getcase}"/>
    <p>{!v.record.Status}</p>
        <p>{!v.record.Subject}</p>
        <p>{!v.record.Description}</p>
</aura:component>

Cheers!!!

There 'CalculateTotal' component is not bound to the 'calculate' controller method

Use the below codes

Component Code:

<aura:component >
<ui:inputNumber aura:id="InputOne"/>
    <ui:inputNumber aura:id="InputTwo"/>
    <ui:inputNumber aura:id="InputThree"/>
    <ui:outputNumber aura:id="totalValue"/>
    <aura:handler name="init" value="{!this}" action="{!c.calculate}"/>
</aura:component>

Controller Code:

({
    calculate : function(cmp) {
Var ip1 = cmp.find("InputOne").get("v.value");;
Var ip2 = cmp.find("InputTwo").get("v.value");;
Var ip3 = cmp.find("InputThree").get("v.value");;
        cmp.find("totalValue").set("v.value",  parseInt("ip1") +  parseInt("ip2") +  parseInt("ip3"));
    }
})

Cheers!!!

The client side controller does not get a value from the inputOne, inputTwo and/or inputThree components

Use the below codes

Component Code:

<aura:component >
<ui:inputNumber aura:id="InputOne"/>
    <ui:inputNumber aura:id="InputTwo"/>
    <ui:inputNumber aura:id="InputThree"/>
    <ui:outputNumber aura:id="totalValue"/>
    <aura:handler name="init" value="{!this}" action="{!c.calculate}"/>
</aura:component>

Controller Code:

({
    calculate : function(cmp) {
Var ip1 = cmp.find("InputOne").get("v.value");;
Var ip2 = cmp.find("InputTwo").get("v.value");;
Var ip3 = cmp.find("InputThree").get("v.value");;
        cmp.find("totalValue").set("v.value",  parseInt("ip1") +  parseInt("ip2") +  parseInt("ip3"));
    }
})

Cheers!!!

The 'PhoneNumberOutput' component is not using a handler component

Use the below code

Component Code:

<aura:component>
    <aura:registerEvent name="message" type="c:PhoneNumberEvent"/>
    <aura:handler event="c:PhoneNumberEvent" action="{!c.answer}"/>
    <aura:attribute name="number" type="String" default="No Phone Number"/>
    <ui:outputText aura:id="phone" value="{!v.number}"/>
</aura:component>

Controller Code:

({
answer : function(component, event, helper) {
var text = event.getParam("phone");
        component.set("v.number", text);
}
})

Cheers!!!

The 'PhoneNumberInput' client-side controller is not setting the phone param

Use the below

Controller Code:

({
send : function(component, event, helper) {
var phone = component.find("phone").get("v.value");
        console.log(phone);
        $A.get("event.c:PhoneNumberEvent").setParams({
            phone: phone
       }).fire();
}
})
    
    ({
answer : function(component, event, helper) {
var text = event.getParam("phone");
        component.set("v.phone", text);
}
})

Cheers!!!

How to auto populate Name field in Salesforce?

To  auto populate Name field in Salesforce, follow the below steps

1. Create a Visuaforce page similar to this below code.

Sample Visualforce page:

<apex:page standardController="Employee__c" action="/a0A/e?RecordType={!$CurrentPage.parameters.RecordType}&Name=[Will+be+filled+automatically]&cancelURL={!$CurrentPage.parameters.retURL}&nooverride=1"
/>

Replace a0A with your object.
To find it, open the object's tab and get it from the URL.


2. Go to object's new button.

3. Edit it to override it.


4. Select the Visualforce page to override the New button and clickc"Save" button.


Output:


Cheers!!!

How to change the logo on the Salesforce Home page?

1. Go to Apps.


2. Edit the App.


3. Select "Insert an Image".


Note:
For standard app, you cannot customize its label or logo.

Cheers!!!

Lightning COmponent - Using Expressions challenge is failing

Sample Code:

<aura:component >
     <aura:attribute name="DayOfTheWeek" type="String" default="Monday" />
    <aura:if isTrue="{!v.DayOfTheWeek == 'Monday'}">
            Today is {!v.DayOfTheWeek}
            <aura:set attribute="else">
                Today is not {!v.DayOfTheWeek}
            </aura:set>
        </aura:if>
</aura:component>

Cheers!!!

The component is not evaluating the value of the 'DayOfTheWeek' attribute to determine what to display

Sample Code:

<aura:component >
     <aura:attribute name="DayOfTheWeek" type="String" default="Monday" />
    <aura:if isTrue="{!v.DayOfTheWeek == 'Monday'}">
            Today is {!v.DayOfTheWeek}
            <aura:set attribute="else">
                Today is not {!v.DayOfTheWeek}
            </aura:set>
        </aura:if>
</aura:component>

Cheers!!!

Lightning Component Tabs Section missing in Salesforce

If Lightning Component Tabs Section missing in Salesforce, follow the below steps

1. Go to My Domain.


2. Click "Click here to login".


3. Click "Deploy to Users".


Still if you are unable to see Lightning Component Tab Section, make sure you have created few Lightning Components which implements "force:appHostable".

Cheers!!!

What is the Lightning Component Framework?

The Lightning Component framework is a UI framework for developing dynamic web apps for mobile and desktop devices.

It’s a modern framework for building single-page applications engineered for growth.

The framework supports partitioned multi-tier component development that bridges the client and server. It uses JavaScript on the client side and Apex on the server side.

Cheers!!!

How query records created today in Salesforce using SOQL?

Sample SOQL:

SELECT Id, Name FROM Account WHERE CreatedDate = YESTERDAY

To get records created today, use the below query

Sample SOQL:

SELECT Id, Name FROM Account WHERE CreatedDate = TODAY

Cheers!!!

How to schedule a Schedulable class at specified time instantly in Salesforce?

Sample Code:

AccountUpdateScheduler obj = new AccountUpdateScheduler();

String cron = '0 30 15 29 10 ? 2015';
System.schedule('Testing', cron, obj);

The above code will execute AccountUpdateScheduler exactly at 3:30 PM on 20th October 2015.

To know more about scheduling, please check the below link

http://www.infallibletechie.com/2014/06/systemschedule-in-apex-scheduler-in.html

Cheers!!!

How to show status of batch job in Visualforce page?

Sample Batch:

global class AccountUpdate Implements Database.Batchable <sObject> {
    global Database.queryLocator start(Database.BatchableContext bc) {
        String SOQL = 'SELECT Id, Description FROM Account';
        return Database.getQueryLocator(SOQL);
    }

    global void execute(Database.BatchableContext bc, List<Account> listAccount) {
        for(Account a : listAccount) {
            a.Description = 'Updated on ' + system.today();
        }
        update listAccount;
    }

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

Visualforce Page:

<apex:page controller="Sample">
<apex:form >
    <apex:pageBlock id="pg">
        <apex:pageBlockSection rendered="{!batchStatusBool}">
            <apex:actionStatus id="act" startText="Checking..." />
            Batch Account Status is {!batchStatus}
            <apex:actionPoller interval="5" action="{!checkBatchStatus}" enabled="{!pollerBool}" reRender="pg" status="act"/>
        </apex:pageBlockSection>
        <apex:pageBlockButtons location="bottom">
            <apex:commandButton value="Call Account Update Batch" action="{!callAcctUpdateBatch}"/>
        </apex:pageBlockButtons>
    </apex:pageBlock>
</apex:form>
</apex:page>

Apex Class:

public class Sample {
    public Boolean batchStatusBool {get;set;}
    public String batchStatus {get;set;}
    Id batchId;
    public Boolean pollerBool {get;set;}

    public Sample() {
        batchStatusBool = false;
        pollerBool = false;
    }
   
    public void callAcctUpdateBatch() {
        batchStatusBool = true;
        AccountUpdate obj = new AccountUpdate();
        batchId = Database.executeBatch(obj, 2);
        checkBatchStatus();
    }
   
    public void checkBatchStatus() {
        AsyncApexJob job = [SELECT Id, Status FROM AsyncApexJob WHERE Id =: batchId];
        batchStatus = job.Status;
        if(batchStatus == 'Completed') {
            pollerBool = false;
        } else {
            pollerBool = true;
        }
    }
}

Output:





Cheers!!!

Last Date for Salesforce Maintenance Exams

Whether you’re already certified or pursuing an advanced credential, there are certain key dates to keep in mind. Below you’ll find information about the important dates for release exams, the Certified Force.com Advanced Developer programming assignment, and the Certified Technical Architect review board.

To know about Salesforce Maintenance Exam Schedules, check the below link

http://certification.salesforce.com/schedules

Cheers!!!

Salesforce Maintenance Exam Schedules

Whether you’re already certified or pursuing an advanced credential, there are certain key dates to keep in mind. Below you’ll find information about the important dates for release exams, the Certified Force.com Advanced Developer programming assignment, and the Certified Technical Architect review board.

To know about Salesforce Maintenance Exam Schedules, check the below link

http://certification.salesforce.com/schedules

Cheers!!!

How to convert integer to String Selenium JAVA WebDriver

String.valueOf() is used to convert integer to String.

Sample Code:

    int day, month, year;
    day = 1;
    month = 10;
    year = 2015;

    String todayDate = String.valueOf(month) + '/' + String.valueOf(day) + '/' + String.valueOf(year);

Cheers!!!

How to get Month, Day and Year in Selenium Java WebDriver

Sample Code:

    int day, month, year;
    int secnd, minute, hour;
    GregorianCalendar date = new GregorianCalendar();

    day = date.get(Calendar.DAY_OF_MONTH);
    month = date.get(Calendar.MONTH);
    year = date.get(Calendar.YEAR);

    secnd = date.get(Calendar.SECOND);
    minute = date.get(Calendar.MINUTE);
    hour = date.get(Calendar.HOUR);

    String todayDate = String.valueOf(month) + '/' + String.valueOf(day) + '/' + String.valueOf(year);

Cheers!!!

Salesforce Interview questions with answers Part 29

1) What is the list View In Visual force?

http://www.infallibletechie.com/2012/11/apexlistviews.html

2) What is test visible?

http://www.infallibletechie.com/2014/05/testvisible-annotation-in-salesforce.html

3) Write a Query to retrieve all the records starting with A from Lead Object?

Like Operator can be used.

http://www.infallibletechie.com/2012/01/like-operator-usage-in-apex.html

4) What is the Best Practice to Avoid Governor Limits While writing Apex?

http://www.infallibletechie.com/2013/01/how-to-bypass-governor-limits-in.html

http://www.infallibletechie.com/2012/11/how-to-bulkify-trigger-code.html

5) What is the best Practice of writing the test classes?

http://www.infallibletechie.com/2012/05/unit-testing.html

6) Different Types of Change Sets and When to use Outbound & Inbound Change Sets

For Deployment, Changes sets are used.

7) Difference Between Repeat & Data list

Repeat is similar to for loop. It displays the data without any styles

Data list is used to display in tabular form.

8) What are the different Components of Visual force?

http://www.infallibletechie.com/2012/11/visualforce-tags-in-salesforce.html

9) What Is the Difference between Database.statefull & Database.batchable?

http://www.infallibletechie.com/2014/06/how-to-maintain-variable-value-inside.html

10) What Is Package.Xml?

Package.Xml is used in Apache ANT tool for deployment. It contains the components list for deployment.

Cheers!!!

Salesforce Freelancers

Salesforce Interview questions with answers Part 28

1. Explain your roles in the project.

http://www.infallibletechie.com/2014/10/what-are-all-roles-and-responsibilities.html

http://www.infallibletechie.com/2014/11/roles-of-salesforce-administrator.html

2. Any custom functionality have you developed?

http://www.infallibletechie.com/2012/06/auto-complete-text-box-in-salesforce.html

http://www.infallibletechie.com/2012/06/dynamically-adding-rows-in-apex.html

3. I have three text fields.. say first name, middle name and last name. I want to make them unique. How can we do it using admin?

Create a field with Unique attribute. Use Field Update WF to update this field with concatenation of First Name, Last Name and Middle Name.

4. I have 2 page layouts p1 and p2, 2 profiles prof1 and prof2,  have 3 field f1, f2 and f3. For prof1 I have p1 and f1 f2 on the page layout .. prof2 has p2 layout and f3 field. Now all the three fields have validation rules. When prof2 user is trying to create a record and save will f1 f2 validation rules get fired ?

Yes they will get fired.

How can we prevent the f1 and f2 validation rules from executing for the prof2 user?

In the Validation rule check the User's profile.

5. Have you worked on workflows approvals? If so, what is it?

http://www.infallibletechie.com/2015/10/approval-process-salesforce.html

6. What are different workflow actions?

http://www.infallibletechie.com/2015/10/what-are-different-workflow-actions-in.html

7. How are workflow actions triggered. i.e., what are the conditions?

http://www.infallibletechie.com/2015/10/how-are-workflow-actions-triggered-in.html

8. What is the difference between when created edited and created any time it’s edited to subsequently meet criteria in Workflow Salesforce ?

http://www.infallibletechie.com/2015/10/what-is-difference-between-when-created.html

9. I have an object and a pick list STATUS. In that values are open, close and win .. I want to send a a mail everyday till the status is open. How can u do that using workflows.

We create a time dependent workflow rule.

10. Triggers and what all the situations they get fired (events )

http://www.infallibletechie.com/2012/08/when-to-use-triggers-in-salesforce.html

11. What are collections?

List, Set and Map

12. What is the difference between collections and primary data types?

Collections can hold group of data.

13. What is Viewstate?

http://www.infallibletechie.com/2012/09/view-state-in-salesforce.html

14. What is required for SOAP API?

WSDL

15. What are all the relationships in salesforce?

http://www.infallibletechie.com/2015/10/relationships-in-salesforce.html

16. What are the difference between Lookup and Master Detail relations?

http://www.infallibletechie.com/2013/02/difference-between-lookup-and-master.html

17. I want to change Master Detail to Lookup.. what are the considerations?

We have to delete the Roll up Summary Fields.

18. How do you write roll up summaries for example say I have an amount field on the child records and it rolls up to TOTAL AMOUNT when it was Master Detail relation . Now its LOOKUP so how to handle this .

1. Use trigger 
2. Use App Exchange product

19. Order of execution

http://www.infallibletechie.com/2013/04/order-of-execution-in-salesforce.html

http://www.infallibletechie.com/2015/05/order-of-execution-in-visualforce-page.html

Cheers!!!

Relationships in Salesforce

1. Lookup

2. Master Detail

3. Self

4. Hierarchical(Special Lookup in User object)

5. Many to Many using Junction object

Cheers!!!

What is the difference between when created edited and created any time it’s edited to subsequently meet criteria in Workflow Salesforce

created:

Workflow will be triggered whenever the record is created.

created, and every time it’s edited:

Workflow will be triggered whenever the record is created and updated.

created, and any time it’s edited to subsequently meet criteria:

Workflow will be triggered whenever the record is created and updated records which previously didn't meet the criteria.

Cheers!!!

How are workflow actions triggered in Salesforce?

1. created

2. created, and every time it’s edited

3. created, and any time it’s edited to subsequently meet criteria

Cheers!!!

What are different workflow actions in Salesforce?

1. Field Update

2. Email Alert

3. Task

4. Outbound Message

Cheers!!!

Approval Process Salesforce

An approval process is an automated process your organization can use to approve records in Salesforce. An approval process specifies the steps necessary for a record to be approved and who must approve it at each step.

Approval steps assign approval requests to various users and define the chain of approval for a particular approval process.Each approval step specifies the attributes a record must have to advance to that approval step, the user who can approve requests for those records, and whether to allow the delegate of the approver to approve the requests. The first approval step in a process specifies the action to take if a record does not advance to that step. Subsequent steps in the process allow you to specify what happens if an approver rejects the request.

Cheers!!!

How to write a validation rule of Multiselect Picklist in Salesforce?

INCLUDES() is used to write a validation rule of Multiselect Picklist in Salesforce.

Determines if any value selected in a multi-select picklist field equals a text literal you specify.

Syntax:

INCLUDES(multiselect_picklist_field, text_literal)

Cheers!!!

How to Switch to Salesforce Classic from Lightning Experience?



Cheers!!!

The page isn't evaluating the 'Prospecting' stage Salesforce Trailhead

Sample Code:

<apex:page docType="html-5.0" standardController="Opportunity" title="Detals">

   <apex:outputPanel rendered="{!if(Opportunity.stagename=='Prospecting',true,false)}">
        This is prospecing tips
   </apex:outputPanel>
   <apex:outputPanel rendered="{!if(Opportunity.stagename=='Needs Analysis',true,false)}">
        This is without prospecing tips
   </apex:outputPanel>
 
   <apex:outputPanel rendered="{!if(Opportunity.stagename=='Proposal/Price Quote',true,false)}">
        This is without prospecing tips
   </apex:outputPanel>
 
   <apex:outputPanel rendered="{!if(Opportunity.stagename=='Negotiation/Review',true,false)}">
        This is without prospecing tips
   </apex:outputPanel>
</apex:page>

Cheers!!!

The page isn't binding a variable Salesforce Trailhead

Sample Code:

<apex:page docType="html-5.0" standardController="Opportunity" title="Detals">

   <apex:outputPanel rendered="{!if(Opportunity.stagename=='Prospecting',true,false)}">
        This is prospecing tips
   </apex:outputPanel>
   <apex:outputPanel rendered="{!if(Opportunity.stagename=='Needs Analysis',true,false)}">
        This is without prospecing tips
   </apex:outputPanel>
 
   <apex:outputPanel rendered="{!if(Opportunity.stagename=='Proposal/Price Quote',true,false)}">
        This is without prospecing tips
   </apex:outputPanel>
 
   <apex:outputPanel rendered="{!if(Opportunity.stagename=='Negotiation/Review',true,false)}">
        This is without prospecing tips
   </apex:outputPanel>
</apex:page>

Cheers!!!

The 'My Data' Lightning App was not found

If you face "The 'My Data' Lightning App was not found", do the following.

1. Register in My Domain.

2. Install the Package only after successful domain registration. You will receive an email from Salesforce.

3. Create a new App Builder with "My Data". If you have the old one, kindly delete it.

Try the below, only if the issue still persists

1. Go to Setup --> Build  --> Develop --> Lightning Components .

2. Check the Enable Lightning Components in Salesforce1 (BETA) checkbox.

3. Save it.

Cheers!!!

How to send email to all the users in the Salesforce organization?

1. Go to Mass Email Users.


2. Create a view or select a view. Click "Go" button.


3. Create an email template for next step. Select the users and click "Next" button.


4. Select the Email Template.


5. Enter Mass Email name and click "Send" button.


Cheers!!!

How to use equals instead of Contains xpath Selenium IDE?

Sample Code for Contains condition:

[contains(text(), "Test")]

Sample Code for Equals condition:

[text() = 'Test']

We have to use equal to (=) operator for Equals Condition in Selenium IDE.

Cheers!!!

Lookup Icon not visible in Lookup field using apex:inputField

If Lookup Icon not visible in Lookup field using apex:inputField, remove standardStylesheets="false" from apex:page tag. Else use the below CSS

.lookupInput
{
    display: inline;
    vertical-align: middle;
    white-space: nowrap;
}
.lookupInput img
{
    background-repeat: no-repeat;
    margin-right: .25em;
    vertical-align: middle;
}
.lookupInput .disabled
{
    background-color: #ccc;
}
.lookupInput .emptyDependentLookup
{
    font-style: italic;
}
.lookupInput input[readonly]
{
    background-color: #e6e6e6;
    border: 2px solid #e6e6e6;
    color: #333;
    cursor: default;
}
.lookupInput a.readOnly
{
    float: right;
}
.lookupInput span.readOnly
{
    display: block;
    white-space: normal;
}
.lookupInput span.totalSummary
{
    font-weight: bold;
}
.inlineEditRequiredDiv .lookupInput img,.inlineEditDiv .lookupInput img
{
    vertical-align: middle;
}
.quickCreateModule .lookupInput input {
    max-width: 155px
}
.lookupIcon {
    background-image: url(/img/func_icons/util/lookup20.gif);
    background-position: 0 0;
    width: 20px;
    height: 20px;
    background-position: top left
}
.lookupIconOn {
    background-image: url(/img/func_icons/util/lookup20.gif);
    background-position: 0 0;
    width: 20px;
    height: 20px;
    background-position: top right
}

Cheers!!!

How to enable Save & Add Product button in Opportunity Creation in Salesforce?

1. Go to Opportunity Settings.


2. Enable "Prompt users to add products to opportunities".


3. When you go to create an Opportunity, you will be able to see "Save & Add Product" button.


Cheers!!!

How to open a web page using Selenium WebDriver?

1. Create a JAVA Class.


2. Enter class name and Save it.


3. Create a method inside the class. In my case I have created startTest().

3. Include @Test annotation.

4. Use the help icon to fix the issue by importing "import org.junit.Test;".


5. Use the below code to open a web page.

                WebDriver wd = new FirefoxDriver();
wd.get("http://www.infallibletechie.com");

6. Fix the errors by importing the below

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;



7. Run it, so that it will open the page.


Cheers!!!

How to save test case as JAVA Webdriver code in Selenium IDE?


Cheers!!!

How to register Salesforce Certification Exam?

To register Salesforce Certification Exam, check the below link

https://s3.amazonaws.com/dfc-wiki/en/images/archive/8/81/20090430184355!Exam_Self-Registration_Step_by_Step_Guide_v4.pdf

Follow the steps provided in the link to register for Salesforce Certification Exam.

Note:

Payment can be done only using Credit Card.

Cheers!!!

Salesforce Components not available through API

Account Contact Roles

Account Teams Roles

Account Team Enablement

Activity Settings

Approval Process

Auto-number on customizable standard fields

Business Hours

Call Center Case Contact Roles

Campaign Influence

Case Assignment Rules

Case Team Roles

Case Escalation Rules

Chatter Settings

Chatter Feed Tracking Settings

Console Layouts

Contracts Settings

Custom Settings Data

Dashboard Component Drill Down Settings

Delegated Administration

Email Bounce Administration

Email-to-Case

Field history tracking enablement

Fiscal Year

Forecasts

Help text on standard fields

HTML Document and Attachment Settings

Label Renaming for Standard Objects

Lead Assignment Rules

Lead Conversion Field Mapping

Lead Settings

Ideas Comment Validation Rule

Ideas Communities

Ideas Settings

Mail Merge Templates

Mobile Administration (ie, Profiles)

Mobile Users and Devices

Network Access Settings

Offline Briefcase Configurations

Opportunity Big Deal Alert

Opportunity Competitors

Opportunity Contact Roles

Opportunity Settings

Opportunity Update Reminders

Organization Wide Defaults on Standard Objects

Page Layout Assignment to Record Types

Partner Management

Partner Roles

Predefined Case Teams

Product Schedule Setup

Product Settings

Public and Resource Calendars

Public Groups

Queues

Role Hierarchies

Running user on dashboards

Salesforce to Salesforce

Sales Team Enablement

Sales Team Roles

Search layouts on standard objects

Search Settings

Self-Service Public Solutions

Self-Service Web-to-Case

Self-Service Portal Settings

Self-Service Portal Users

Self-Service Portal Font and Colors

Sharing Rules

Solution Categories

Solution Settings

Support Auto-Response Rules

Tab Renaming for Standard Objects

Tag Settings

Territory Assignment Rules

User Interface Settings

Web Links on PersonAccount page layouts

Web-to-Lead

Web-to-Lead Auto-Response

Some profile components (standard tab access, general and user perms sections, app access & settings)

Workflow Task Translations

Check the below link for more info

https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_unsupported_types.htm

Cheers!!!

Salesforce Components available through API

Custom fields

Custom objects

Apex classes

Apex triggers

Apex components

Visualforce pages

S-controls

RecordTypes

Profiles

Field level security

Help text on custom fields

Sales, Lead, Cases Processes

Custom applications (tabsets)

Custom tabs

Documents

Folders

Package

Weblink

Email template

Letterhead

Picklist/RecordType map

Analytic Snapshots

Folder Access Settings

Custom buttons

Static resources

Custom links

Workflows

Page layouts

Home page components

Home page layouts

Validation rules

Approval processes

Org Wide Security Settings on Custom Objects

Custom Labels

Custom report types

Button overrides

Field dependencies

Picklists

Dashboards

Reports

List views

Email attachments

Tag API New!

Cheers!!!

How to Delete Lightning Component in Salesforce?

1. Open the component in Developer Console.

2. Go to File --> Delete.


Cheers!!!

How to set field permission from Schema Builder in Salesforce?

1. Right Click the field and select "Manage Field Permissions".


2. Set the Field Permissions.


Cheers!!!

How to install and setup Selenium WebDriver?

1. Go to the below link

http://www.seleniumhq.org/download/

2. Under Selenium Client & WebDriver Language Bindings, download the WebDriver according to your programming language.

In my example, I am selecting Java.


3. Extract the Zip file.

4. Open your Eclipse.

5. Go to File --> New --> Java Project.


6. Give any name to the project and click "Finish" button.


7. Create a new Package.


8. Give any name to the project and click "Finish" button.


9. Right Click the Project and select Build Path --> Configure Build Path...


10. Select Libraries and click "Add External JARs..".


11. Add the Jars from the extracted WebDriver folder.


12. Add the Jars from Libs folder too.


13. You should be able to see the Jars in Referenced Libraries.


Note:

Don't delete the JARs after adding it to the package from the source directory.

Cheers!!!

Preview Button in Salesforce Lightning


Cheers!!!

How to cover addError() in trigger in Apex Test?

Sample Trigger:

trigger RestrictContactByName on Contact (before insert, before update) {
    
    for (Contact c : Trigger.New) {
        if(c.LastName == 'INVALIDNAME') {   //invalidname is invalid
            c.AddError('The Last Name "'+c.LastName+'" is not allowed for DML');
        }

    }
}

Sample Test Class:

@isTest
private class TestRestrictContactByName {
    @isTest static void test() {
        Contact c = new Contact(LastName = 'INVALIDNAME');
        Database.SaveResult result = Database.insert(c, false);
        System.assertEquals('The Last Name "'+c.LastName+'" is not allowed for DML',result.getErrors()[0].getMessage());
    }
}

Cheers!!!

Permission to create Apex Classes in Salesforce

Author Apex permission in System Permissions in profile allows users to create Apex Classes.


Cheers!!!

How to upsert using External Id using Apex in Salesforce?

Sample Code:

upsert listAccount Account.Fields.External_Field__c;

here listAccount is the List<Account> and External_Field__c is an External field.

Upsert uses the sObject record's primary key (the ID), an idLookup field, or an external ID field to determine whether it should create a new record or update an existing one:

1. If the key is not matched, a new object record is created.
2. If the key is matched once, the existing object record is updated.
3. If the key is matched multiple times, an error is generated and the object record is neither inserted or updated.

Cheers!!!

Simple Apex Class to return list of string based on the length provided

Sample Code:

public class StringArrayTest {
    public static List<String> generateStringArray(Integer i) {
        List<String> listString = new List<String>();
        for(Integer j = 0; j < i ; j++) {
            listString.add('Test ' + j);
        }
        return listString;
    }
}

Cheers!!!

How to call Visual Workflow in Visualforce page

Sample Code:

<apex:page >
    <flow:interview name="New_Customer_Flow"></flow:interview>
</apex:page>

Output:


Cheers!!!

Today plus x days in Visual Workflow in Salesforce

1. Create a formula field.


2. Enter the details as mentioned below.


Cheers!!!

The flow must have a start item issue in Salesforce


Cheers!!!

Process Builder in Salesforce

The Process Builder is a tool that allows you to easily automate business processes using a convenient graphical representation of your process as you build it.

Automated processes in the Process Builder consist of:
1. Criteria that determine when to execute action groups and

3. Immediate and scheduled actions to execute when those criteria are met.

Any change that causes a record to match the criteria automatically triggers the action group.

Sample Process Builder:

Scenario:

Update Contact mailing address fields (Street, City, State, Post Code, Country) when the parent Account shipping address field values are updated.

1. Go to Build --> Create --> Workflow & Approvals --> Process Builder.


2. Click "New".


3. Enter the name and description.

4. Click "Save".



5. Select Add Object. Select the conditions as below and click "Save".


6. Click "Add Criteria". Select the criteria as below and select a field.


7. Select the field.


8. Choose the field.


9. Select all the Shipping fields. Select Is Changed as the operator and value as True and click "Save".


10. Click "Add Action". Enter and select the options as below and click "Save".


11. Activate the Process Builder.


Cheers!!!