Forum Replies Created

Page 5 of 5
  • @isTest

    Use the @isTest annotation to define classes and methods that only contain code used for testing your application.

    One Test class can have Multiple @isTest methods

    @testSetup

    Methods defined with the @testSetup annotation are used for creating common test records that are available for all test methods in the class.

    One Test class can have only one @testSetup methods

  • Yogesh

    Member
    August 12, 2019 at 2:16 pm in reply to: What is an empty SandBox in Salesforce?

    Hello nikita,

    If you create a "Developer" or "Developer Pro" sandbox, it will have no data.
    Metadata, however, will be copied - so the developer will have the same custom objects and fields, workflow rules, etc, that you have on production.

  • Yogesh

    Member
    August 12, 2019 at 8:35 am in reply to: How we can link two Vf pages in salesforce ?

    Hello,

    Put the below code in the controller action method that is being called on click of command button

    public class myControllerExtension {
    public myControllerExtension(ApexPages.StandardSetController controller) { }
    public PageReference OpenPage() {
    PageReference pr = new PageReference('/apex/Your_Second_Page_Name');
    pr.setRedirect(true);
    return pr;
    }
    }

  • Yogesh

    Member
    August 9, 2019 at 2:56 pm in reply to: What is doInit in lightning component?

    This event is automatically fired when an app or component is initialized, prior to rendering.

    Component-

    <aura:component>

    <aura:handler name=”init” value=”{!this}” action=”{!c.doInit}”/>

    </aura:component>

    jsController-

    ({
    doInit: function(cmp) {
    // Set the attribute value.
    // You could also fire an event here instead.
    alert(‘test’);
    }
    })

  • Well I was able to find the below two reasons to use Extensions. In fact Controllers & Extensions are for same purpose which I understood.
    1. Suppose there exists a VF page which has a custom controller called on it, and it is well tested and currently in use by the end users, if you want to add additional functionality on this VF page, you better don't disturb the existing program which would hit your business big time in case if anything goes wrong, rather write an extension and use it on VF Page.

    2. We can't call multiple custom controllers on a VF Page, but we can call second controller while we have the first controller on VF page, and however you need to define your second controller as Extension rather as controller.

  • Yogesh

    Member
    August 9, 2019 at 2:50 pm in reply to: What is mock test class in Salesforce and is it important?

    To deploy or package Apex, 75% of your code must have test coverage. By default, test methods don’t support HTTP callouts, so tests that perform callouts fail. Enable HTTP callout testing by instructing Apex to generate mock responses in tests, using Test.setMock.

    example :-

    public class CalloutClass {
    public static HttpResponse getInfoFromExternalService() {
    HttpRequest req = new HttpRequest();
    req.setEndpoint('http://example.com/example/test');
    req.setMethod('GET');
    Http h = new Http();
    HttpResponse res = h.send(req);
    return res;
    }
    }

  • Yogesh

    Member
    August 9, 2019 at 12:07 pm in reply to: What is Lightning Design System (SLDS)?

    The Salesforce Lightning Design System (SLDS) component library is actively developed to enable Salesforce developers to create a uniform look and feel across all Salesforce-related applications while adhering to CSS best practices and conventions.

  • Yogesh

    Member
    August 9, 2019 at 11:55 am in reply to: What is the use of Apex Continuation object in Salesforce?

    on Continuation object in Apex – Asynchronous callouts for long running request – Live Demo
    We may run into scenario in Salesforce project, where we need call external web service but no need to wait for response. Response from external web service can be processed asynchronously and once processed it can be presented in Visualforce page.

    so we can accomplish this by using  Continuation object as well.

  • Yogesh

    Member
    August 9, 2019 at 11:47 am in reply to: How can I link two Visualforce pages in Salesforce?

    Hello laveena, it might help you

    Vf code

    <apex:commandButton action="{!Move}" value="Next VF page"/>

    controller code:

    public PageReference Move()
    {
    PageReference Page = new PageReference('/apex/vfname');
    Page.setRedirect(true);
    return Page;
    }

  • As far as I know ,there is no other option except changing the profile information or profile what you mentioned because a permission set is always additive in nature so it cannot be used to limit/narrow down permissions.

Page 5 of 5