Posts

What are the types of bindings available in Salesforce Visualforce?

There are three types of bindings used in Visualforce. Data binding Action bindings Component bindings Data bindings refer to the data set in the controller. Action bindings refer to action methods in the controller. Component bindings refer to other Visualforce components.

Interfaces salesforce

An  interface   is like a class in which none of the methods have been implemented—the method signatures are there, but the body of each method is empty. To use an interface, another class must implement it by providing a body for all of the methods contained in the interface. Interfaces can provide a layer of abstraction to your code. They separate the specific implementation of a method from the declaration for that method. This way you can have different implementations of a method based on your specific application. Defining an interface is similar to defining a new class. For example, a company might have two types of purchase orders, ones that come from customers, and others that come from their employees. Both are a type of purchase order. Suppose you needed a method to provide a discount. The amount of the discount can depend on the type of purchase order. You can model the general concept of a purchase order as an interface and have specific implementations fo...

How to resolve the View State Error ?

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. In Visualforce, page state is persisted as a hidden form field that is automatically inserted into a form when the page gets generated. We call this the view state of the page. The view state captures the state of the page -- state of its associated controllers and extensions and the component tree on the page. The view state is posted back along with the other form data, which gives the server enough information to recreate the page state to which new changes can be applied . What is Contained in the View State: The data in the view state should be sufficient to recreate the state of the page when the postback is received. To do this, it stores the followin...

How to convert master-detail relationship to lookup relationship ,Is there any data loss ?

If A object is master of B object then if you need to change this master-detail relationship to lookup then you only need to click on setup -> Object ---> Master detail field --> Edit ---> Now you will not be able to see button "change field type". if there is Roll up summary field on Master object so delete it first and also remove it from "deleted fields" trash box then you will be able to see "change field type" button. Changes OWD setting : If you are converting a master-detail relationship to a lookup for a custom object on the “detail” side, the organization-wide default for the object is automatically updated to Public Read/Write. Similarly, converting a lookup to a master-detail-relationship changes the organization-wide default to Controlled by Parent Note: 1. You can convert a master-detail relationship to a lookup relationship as long as no roll-up summary fields exist on the master object. 2. You can convert a lookup relationship t...

General Lightning Questions

Q: What is Lightning? A: Lightning is the collection of tools and technologies behind a significant upgrade to the Salesforce platform. Lightning includes: Experience: A set of modern user interfaces optimized for speed. This includes the Lightning Experience, Salesforce1 Mobile app and template-based communities. Lightning Component Framework: A JavaScript framework and set of standard components that allow you to build reusable components to customize the Lightning Experience, Salesforce1 Mobile app and template-based communities and build your own standalone apps. Visual Building Tools: Drag-and-drop technologies for fast and easy app building & customizations. Use the Lightning App Builder to customize the Lightning Experience and Salesforce1 Mobile app. Use the Community Builder to customize template-based communities. Lightning Exchange : A section of the AppExchange where you can find 70+ partner components to jumpstart your development. Lightni...

Why can’t I see the Sharing button on a record in Salesforce Classic?

The Sharing button lets users grant other users access to a record beyond the organization-wide defaults or sharing rules. You can easily remove this access after it’s no longer needed. You have access to the Sharing button when your sharing model is either Private or Public Read Only for a type of record or related record. For example, the Sharing button may appear on an account even though your organization-wide default for accounts is Public Read/Write, if your organization-wide default for related opportunities is Public Read Only. When the button is available on the page layout, administrators see the button on all records. Non-administrators see this button on records that only they own.

What is the purpose of Test.startTest() and Test.stopTest() in Salesforce?

Test.startTest() and Test.stopTest() are very useful when your test class hits Salesforce Governor Limits. The code inside Test.startTest() and Test.stopTest() have new set of Salesforce Governor Limits. As a good practice, make sure initializing the variables, fetching records, creating and updating records are coded before Test.startTest() and Test.stopTest() and calling the controllers for code coverage is done inside Test.startTest() and Test.stopTest(). The code before Test.startTest() and after Test.stopTest() have new set of Salesforce Governor Limits and code between Test.startTest() and Test.stopTest() have new set of Salesforce Governor Limits. Sample Test Class: private class TestClass {         static testMethod void test() {                  /*                           Dec...