Skip to main content

Posts

Salesforce Visual Force Interview Questions-1

1. What is visualforce controller in salesforce? What are they? Visualforce controller is a set of instructions that specify what happens, when user interacts with components on visualforce pages, such buttons & links. Here are the 3 types of controller   1.  Standard Controller,  2. Custom controller &  3. Controller extensions. 2. What is Standard Controller?  Standard controller provides the salesforce in built functionality to interact with visualforce pages. You can use the standard actions like Save, Edit, Cancel & delete by using standard controllers. Syntax : <apex:page standardController=”Account”> 3. What is Custom Controller? Custom controller is an apex class that implements customized logic to visualfore pages. We can override or create new functionality by using custom controllers. Syntax: <apex:page controller=”Account” > 4. What is Standard List Controller? Standard List Controller allow...

How to prevent the changes to the field in Salesforce after it has been saved?

If the requirement is to prevent the changes to a field after it has been saved initially, there can many ways to do it but the best approach would be from the Validation rules. Its quite simple in Validation rule than doing the same in triggers with apex code. Lets take an example, In the Orders Object you have custom field 'Initial_Payment_Made__c" and once this field has been saved, we should not be able to edit or prevent any changes to this field. We can create a validation rule for this as below. AND(    ISCHANGED( Initial_Payment_Made__c ),    NOT( ISNEW() ) )

Salesforce Dashboards : Points to Remember

A dashboard is a visual display of key metrics and trends for records in your org. The relationship between a dashboard component and report is 1:1; for each dashboard component, there is a single underlying report. However, you can use the same report in multiple dashboard components on a single dashboard (e.g., use the same report in both a bar chart and pie chart). Multiple dashboard components can be shown together on a single dashboard page layout, creating a powerful visual display and a way to consume multiple reports that often have a common theme, like sales performance, customer support, etc. Points to Remember: Each dashboard component has Data sources with source report and components which are visual format like graph, chart or gauge To create a dashboard component, drag the report from Data sources into Dashboards area and Drag the visual component to the same area.  Visualforce pages can also be added to the Dashboards to show custom interfaces Dashboar...

Deploying Metadata Migration Failed

While Deploying Metadata in your Org thru ANT tool fails with below error, even though you have enter the right username and password with security token and URL.  BUILD FAILED D:\Salesforce Migration Tool\salesforce_ant_38.0\sample\build.xml:60: Invalid username, password, security token; or user locked out. In this case, its quite possible that, you are deploying Apex classes to production environment, and total test coverage is not greater than 75% or all the Classes or not covered with test classes.  In case you are deploying to another sandbox or dev environment then you don't need to test your classes.

Multiple active sessions of API connection with external system

Sometimes, when an API connects with an external system, it cannot use same session and hence will be requesting new session (previous session will still be active) each time it connects with Salesforce. In such scenarios many questions arise as below.  - What happens to previous sessions? - Do they expire automatically after 120 minutes? - At a given time, how many active sessions there can be? - What are the implications of multiple open sessions at given point in time?  Depending on how they are created, your session responds accordingly. For example, if you are using the SOAP API to call login () with the same credentials from a single device, you will likely get the same session Id back. Beware of calling logout () here, as you will end both (being the same session). Expiry time will be controlled by the configuration. Default is 120 minutes after last activity, but this can be changed. The limiting factor in terms of usage will be the Concurrent API...

How to add Related List to the Opportunity page Layout?

In order to add Related List to the Opportunity Page Layout, follow below steps.  ·          One of the requirements is that the respective Custom Object should have a relationship (Master Detail or Lookup) with the standard Opportunity object. You can accomplish this by creating a custom field of type Master Detail or Lookup on your Custom Object where Opportunity is the parent . ·          Next step would be navigate to  Setup > Opportunity in Quick Find within Side Panel > Page Layouts > Edit > Related Lists from the top panel > Drag and drop the appropriate related list from the top panel to the page layout > Save.

Finding and Deleting Duplicate Records in Salesforce

Let’s suppose you have duplicate records in an entity, say Opportunities with some custom field Opportunity Number being same for multiple records. These are redundant records which may not be useful and you want to get rid of it.  In order to delete these records, you may think of making this field as unique but, this is not allowed without removing duplicates in this field.  One of the ideal option is to go to developer console (Setup > Developer Console) and run below query.  1 select   id,name,Oppty_Number__C from   opportunity order   by   Oppty_Number__C   With this you can not only see the opportunity records but also edit and delete the unwanted ones.  Also, not in the above query you can user "Group By" clause, but if you use this you cannot edit the resulting records.