Tuesday, 12 July 2016




How to change required symbol color in Visualforce Page ?


For getting the above requirement Copy paste the below code in your visualforce page

<apex:page standardController="Account"> 
    <style>
    .requiredBlock {
        background-color: green !important;
    }
    </style>
    <apex:form > 
        <apex:pageBlock > 
            <apex:pageBlockSection title="Account Information" collapsible="true"> 
                <apex:inputField value="{!account.name}" required="true"/> 
                <apex:inputField value="{!account.type}" required="true"/> 
                <apex:inputField value="{!account.Industry}" required="true"/> 
                <apex:inputField value="{!account.rating}" required="true"/> 
             </apex:pageBlockSection> 
              <apex:pageblockButtons >
                    <apex:commandButton value="Save" action="{!save}"/>
<apex:pageblockButtons> 
        </apex:pageBlock> 
    </apex:form> 
 </apex:page>

In above code you will find a CSS with class "requiredBlock" which you will find when you right click the visualforce page and click on Inspect Element like below.

In above image you will find a div tag with class as requiredBlock which is acting for displaying required symbol so you need to use this class in your customized CSS inorder to override perdefined color(RED).

Final Output:



Note : The !important rule is a way to make your CSS cascade but also have the rules you feel are most crucial always be applied. A rule that has the !important property will always be applied no matter where that rule appears in the CSS document.






Monday, 11 July 2016




Salesforce Interview Question and Answer Part - 1


1. What are different kinds of reports?

-> Tabular: Tabular reports are the simplest and fastest way to look at data. Similar to a spreadsheet, they consist simply of an ordered set of fields in columns, with each matching record listed in a row. Tabular reports are best for creating lists of records or a list with a single grand total. They can’t be used to create groups of data or charts, and can’t be used in dashboards unless rows are limited. Examples include contact mailing lists and activity reports.

-> Summary: Summary reports are similar to tabular reports, but also allow users to group rows of data, view subtotals, and create charts. They can be used as the source report for dashboard components. Use this type for a report to show subtotals based on the value of a particular field or when you want to create a hierarchical list, such as all opportunities for your team, subtotaled by Stage and Owner. Summary reports with no groupings show as tabular reports on the report run page.

-> Matrix: Matrix reports are similar to summary reports but allow you to group and summarize data by both rows and columns. They can be used as the source report for dashboard components. Use this type for comparing related totals, especially if you have large amounts of data to summarize and you need to compare values in several different fields, or you want to look at data by date and by product, person, or geography. Matrix reports without at least one row and one column grouping show as summary reports on the report run page.

-> Joined: Joined reports let you create multiple report blocks that provide different views of your data. Each block acts like a “subreport,” with its own fields, columns, sorting, and filtering. A joined report can even contain data from different report types.


2. What are different kinds of dashboard component?

-> Chart: Use a chart when you want to show data graphically.

-> Gauge: Use a gauge when you have a single value that you want to show within a range of custom values.

-> Metric: Use a metric when you have one key value to display.

     * Enter metric labels directly on components by clicking the empty text field next to the grand total.

     * Metric components placed directly above and below each other in a dashboard column are displayed together as a single component.

-> Table: Use a table to show a set of report data in column form.

-> Visualforce Page: Use a Visualforce page when you want to create a custom component or show information not available in another component type.

-> Custom S-Control: Custom S-Controls can contain any type of content that you can display or run in a browser, for example, a Java applet, an ActiveX control, an Excel file, or a custom HTML Web form


3. What actions can be performed using Workflows?

    Following workflow actions can be performed in a workflow:

-> Email Alert:
    Email alerts are workflow and approval actions that are generated using an email template by a workflow rule or approval process and sent to designated recipients, either Salesforce users or others. Workflow alerts can be sent to any user or contact, as long as they have a valid email address.

-> Field Update:
    Field updates are workflow and approval actions that specify the field you want updated and the new value for it. Depending on the type of field, you can choose to apply a specific value, make the value blank, or calculate a value based on a formula you create.

-> Task:
     Assigns a task to a user you specify. You can specify the Subject, Status, Priority, and Due Dateof the task. Tasks are workflow and approval actions that are triggered by workflow rules or approval processes

-> Outbound Message:
    An outbound message is a workflow, approval, or milestone action that sends the information you specify to an endpoint you designate, such as an external service. An outbound message sends the data in the specified fields in the form of a SOAP message to the endpoint.


4. What are groups in SFDC and what is their use?

    Groups are sets of users. They can contain individual users, other groups, the users in a particular  role or territory, or the users in a particular role or territory plus all of the users below that role or  territory in the hierarchy.

    There are two types of groups:

    Public groups: Only administrators can create public groups. They can be used by everyone in the organization.

    Personal groups: Each user can create groups for their personal use.

    You can use groups in the following ways:

     -> To set up default sharing access via a sharing rule.
     -> To share your records with other users.
     -> To specify that you want to synchronize contacts owned by others users.
     -> To add multiple users to a Salesforce CRM Content library.
     -> To assign users to specific actions in Salesforce Knowledge.

5. What is Visualforce View State?

    Visualforce pages that contain a form component also contain an encrypted, hidden form field that  encapsulates the view state of the page. This view state is automatically created, and as its name  suggests, it holds the state of the page – state that includes the components, field values and  controller state.

- > Minimize number of form on a page. Use apex:actionRegion instead of using 2 or more forms.

-> Refine your SOQL to only retrieve the data needed by the page.

-> All public and private data members present in Standard,Custom and Controller extensions are  saved.

-> The transient variables are not passed to view state and therefore not stored in View State.


6. Which objects can be imported by Import Wizard?

    Following objects can be imported using import wizard.

    Accounts 
    Contacts
    Leads
    Solutions 
    Custom Objects


7. What is Profile and Components?

    Profile contains user permissions and access settings that control what users can do within their  organization.

    A collection of settings and permissions that define how a user accesses records

–  Determines how users see data and what they can do with in the application.
–  A profile can have many users, but a user can have only one profile.

    Profiles Components:

    -> Which standard and custom apps users can view
    -> Which tabs users can view
    -> Which record types are available to users
    -> Which page layouts users see 
    -> Object permissions that allow users to create, read, edit and delete records
    -> Which fields within objects users can view and edit
    -> Permissions that allow users to manage the system and apps within it.
   -> Which Apex classes and Visualforce pages users can access
   -> Which desktop clients users can access
   -> The hours during which and IP addresses from which users can log in.
   -> Which service providers users can access (if Salesforce is enabled as an identity provider)

8. What is Permission Set?

    Permission Set represents a set of permissions that’s used to grant additional access to one or more users without changing their profile or reassigning profiles. You can use permission sets to grant access, but not to deny access.

    Every Permission Set is associated with a user license. You can only assign permission sets to users who have the same user license that’s associated with the permission set. If you want to assign similar permissions to users with different licenses, create multiple permission sets with the same Permissions, but with different licenses.

   Permission sets include settings for:

   -> Assigned apps
   -> Object settings, which include:
       * Tab settings
       * Object permissions
       * Field permissions
   -> App permissions
   -> Apex class access
   -> Visualforce page access
   -> System permissions
   -> Service providers (only if you’ve enabled Salesforce as an identity provider)


9. Profile Vs Permission Sets Permissions and Access Settings?

1. User permissions and access settings specify what users can do within an organization.

2. Permissions and access settings are specified in user profiles and permission sets. Every user is assigned only one profile, but can also have multiple permission sets.

3. When determining access for your users, it’s a good idea to use profiles to assign the minimum permissions and access settings for specific groups of users, then use permission sets to grant additional permissions.

10. What are the Standard Profiles available in Salesforce?

-> Standard User – Can view, edit, and delete their own records

-> Solution Manager – Standard User permissions + Can manage published solutions + Can manage categories

-> Marketing User – Standard User permissions + Can import leads for the organization

-> Contract Manager – Standard User permissions + Can edit, approve, activate and delete contracts

-> Read-Only – Can only view records

-> System Administrator – “Super User,” can customize and administer the application


Basic Salesforce Interview Question and Answers 


1.What is Cloud Computing ?
Pictorial representation of internet is Cloud.Cloud Computing is nothing but internet computing.

With this approach everything can be done in internet (Using Application, Developing Application and distributing the hardware), no need of any minimum hardware requirements and no need to install any software in local system.

Cloud Computing is an approach to provide the following services -
SAAS (Software As A Service)
PAAS (Platform As A Service)
IAAS (Infrastructure As A Service)

2.What is the difference between public cloud and private cloud? Is salesforce.com is a public cloud or private cloud?

Public Cloud: Could services are provided “as a service” over the Internet with little or no control over the underlying technology infrastructure. More than one tenant can use the same resources.

Private Cloud: This also offers activities and functions “as a service” but is deployed over a company intranet or hosted datacenter. This is private product for a company or organization offering advance security.

Salesforce.com: Is a public cloud as it is hosted on salesforce.com data centers and data of more than one tenant resides on same servers.

3.What is Salesforce?

Salesforce is a web based tool .Salesforce by following the Cloud Computing approach, providing SAAS and PAAS

SAAS: Providing Sales, Marketing and Call Center applications as a service

PAAS: Providing Force.com platform in which we can develop Apex (Programming language similar to Core Java) and Visualforce (Mark up language similar to HTML) logic

4. What is Production?

We should not make coding changes in production since end-users are using the application from production environment.

 production url :- login.salesforce.com

5.What is Sandbox ?

To make any changes for the exiting application we should copy all contents of the production into sandbox and make all changes after that test thoroughly and move those changes into production. 

To create the sandbox, in production we can find one link called sandboxes. by clicking on that link we can create the sandbox by choosing type of the sandbox.

sandbox url :- test.salesforce.com

6. What are the types of Sandboxes?

- > Developer Sandbox : 
* It copy only configuration changes from the production
* It won’t copy real time data
* We can test the configuration changes with sample data
* Sample data limit is 200mb
* Refresh time interval is one day
* If we refresh all the sandbox contents will be replaced with production contents

-> Developer pro sandbox:
* Copy configuration changes
* No real time data
* Sample data limit is 1GB
* Refresh time interval one day

-> Partial data sandbox
* Copy configuration changes
* Copy certain amount of real time data
* Real time data limit is 5GB
* For each table it can copy maximum of 10k records
* Refresh interval 5 days

-> Full copy sandbox
* It is exact replica of the production
* Copy both configuration and entire real time data from the production
* Refresh time interval 29 days


OOPs Concepts

) What is polymorphism?
When one task is performed by different ways
Method Overriding and Method Overloading

2) What is inheritance?
Inheritance allows a Child class to inherit properties from its parent class

3) What is an abstraction ?(salesforce Access Specifies)
Hiding internal details and showing functionality is known as abstraction. For example: phone call, we don't know the internal processing.

4) What is Encapsulation?
Binding (or wrapping) code and data together into a single unit is known as encapsulation. For example: capsule, it is wrapped with different medicines.

5) What is Association?
Association is a relationship where all object have their own life-cycle and there is no owner. Let's take an example of Teacher and Student. Multiple students can associate with single teacher and single student can associate with multiple teachers.

6) What is Aggregation?
Aggregation is a specialize form of Association where all object have their own life-cycle but there is ownership and child object can not belongs to another parent object. Let's take an example of Department and teacher. A single teacher can not belongs to multiple departments, but if we delete the department teacher object will not destroy.

7) What is Composition ?
Composition is again specialize form of Aggregation and we can call this as a "death" relationship. It is a strong type of Aggregation. Child object dose not have their life-cycle and if parent object deletes all child object will also be deleted. Let's take again an example of relationship between House and rooms. House can contain multiple rooms there is no independent life of room.



How to group header for two apex:columns while using pageblock table?


In order to achive above functionality you need to "pack" two values into the one apex:column using the html table

<apex:pageBlock title="Page Block Title">
 <apex:pageBlockTable value="{!accounts}" var="a" >
        <apex:column headerValue="My header">
             <table class="tbl">
                   <tr><td>
                          <apex:outputField value="{!a.Name}" /></td><td>
                          <apex:outputField value="{!a.CustomerPriority__c}" />
                  </td></tr>
              </table>
        </apex:column>
        <apex:column value="{!a.Id}"/>
    </apex:pageBlockTable>
</apex:pageBlock>

And apply the below CSS

<style>
.tbl {
    border: none;
    width: 100%;
    margin: 0;
    padding: 0;
}
.tbl td {
    width: 50%;
    border: none !important;
    margin: 0;
    padding: 0;
}
</style>

Expected Output


Tuesday, 8 March 2016



What Is the Difference Between Sales Cloud and Services Cloud ?


1. "Sales Cloud" refers to the "sales" module in salesforce.com. It includes Leads, Accounts, Contacts, Contracts, Opportunities, Products, Price books, Quotes, and Campaigns . It includes features such as Web-to-lead to support online lead capture, with auto-response rules. It is designed to be a start-to-end setup for the entire sales process; you use this to help generate revenue.

WhileService Cloud" refers to the "service" (as in "customer service") module in salesforce.com. It includes Accounts, Contacts, Cases, and Solutions. It also encompasses features such as the Public Knowledge Base, Web-to-case, Call Center, and the Self-Service Portal, as well as customer service automation (e.g. escalation rules, assignment rules). It is designed to allow you to support past, current, and future clients' requests for assistance with a product, service, and billing. You use this to help make people happy.

2. Sales Cloud Implements Sales and Marketing while Service cloud implements Salesforce Knowledge.

3. Sales Cloud ,A great solution for small and value oriented mid-sized sales groups that want to rapidly and cost effectively deploy Salesforce While Service Cloud  provides Customer Support to the Clients and giving you the tools to provide a better customer experience for your clients. 

4. Sales Cloud gives you the ability to open Cases (issues) and relate them to Accounts, Contacts; etc. While The Service Cloud is a superset of Sales Cloud, meaning you get everything that is in Sales Cloud PLUS some other features.

5.When we develop product in force.com for sales then it comes in Sales Cloud Ex: - Account, Contacts, and Lead.  While when we want to provide some facility and also provides support to the clients then it comes in Service Cloud. Ex: - create cases is the example of Service Cloud in which client write his problem into cases instead of call.


Comparison table for Sales Cloud and Service Cloud functionality

Tuesday, 1 March 2016



How to delete existing Apex Scheduled jobs from Apex ?


         Step 1 : Create a Apex Class and copy past the below code in it

         public class CronTrigger
           {
                public List<CronTrigger> listCronTrigger;
               public void testing()
              {
                   listCronTrigger = [select Id from CronTrigger  where ( CronJobDetail.Name like 'yourjobname')  limit 10];
           
                    System.debug('No of jobs: '+listCronTrigger.size());
    
                    If (listCronTrigger.size() > 0)
                   {
                             for (Integer i = 0; i < listCronTrigger.size(); i++)
                            { 
                                   System.abortJob(listCronTrigger[i].Id);
                                   System.debug('Job details ::'+String.valueOf(listCronTrigger[i]));
                            }
                     }
               }
          }

          Step 2 : Create a VF page and call testing method on load 

       On every page refresh 10 jobs will be deleted.


Tools for Lightning Web Component Development

 Below are the tools required for Web Component Development 1. Chrome Browser (Prefered) You can download it from Google 2. Visual Studio Co...