Posts

Showing posts from September, 2018

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...

Using Limits, startTest and stopTest

The Limits methods return the specific limit for the particular governor, such as the number of calls of a method or the amount of heap size remaining. There are two versions of every method: the first returns the amount of the resource that has been used in the current context, while the second version contains the word “limit” and returns the total amount of the resource that is available for that context. For example,  getCallouts  returns the number of callouts to an external service that have already been processed in the current context, while  getLimitCallouts  returns the total number of callouts available in the given context. In addition to the Limits methods, use the  startTest  and  stopTest  methods to validate how close the code is to reaching governor limits. The  startTest  method marks the point in your test code when your test actually begins. Each test method is allowed to call this method only once. All of the...