Forum Replies Created

Page 8 of 8
  • In certain situation, it is possible that you can cover all if condition in a single method. If it is not covering than make different methods for uncovered conditions.

  • Deepak

    Member
    August 20, 2019 at 12:32 pm in reply to: How to convert Javascript objects into Salesforce JSON?

    JSON is to collect as JSON data from a web server as a file or HTTP request and convert the JSON data to a JavaScript, and then it avails the data in a web page.

    The JSON.parse() method parses a JSON string, constructing the JavaScript value or object described by the string.

  • Deepak

    Member
    August 20, 2019 at 12:29 pm in reply to: How can we use Lightning Components with the Salesforce Mobile App?

    Make your Lightning components available for Salesforce for Android, Salesforce for iOS, and Salesforce mobile web users by displaying them in a custom tab.
    Available in: Salesforce Classic (not available in all orgs) and Lightning Experience
    Available for use in: Contact Manager, Group, Professional, Enterprise, Performance, Unlimited, and DeveloperEditionsCreate Lightning components using the UI in Enterprise, Performance, Unlimited, Developer Editions, or a sandbox

    To create Aura components, use the Developer Console.
    Include your components in the navigation menu by following these steps.
    Create a custom Lightning component tab for the component. From Setup, enter Tabs in the Quick Find box, then select Tabs.

    Add your Lightning component to the Salesforce app navigation menu.From Setup, enter Navigation in the Quick Find box, then select Salesforce Navigation.
    Select the custom tab you just created and click Add.
    Sort items by selecting them and clicking Up or Down.In the navigation menu, items appear in the order you specify. The first item in the Selected list becomes your users’ landing page.
    Check your output by going to Salesforce mobile web. Your new menu item should appear in the navigation menu.

  • Deepak

    Member
    August 14, 2019 at 7:57 am in reply to: How can salesforce AppExchange benefit our company?

    In AppExchange’s huge repository, some apps are free, while many carry a subscription fee. Apps are categorized in three main ways:

    By type (apps, components, Lightning Bolt solutions)
    By product (sales, services, marketing, etc.)
    By industry (government, education, finance, etc.)
    Salesforce AppExchange products come in two flavors: Managed packages and unmanaged packages.

    Unmanaged packages are typically used to distribute open-source projects and applications so that developers have the basic building blocks of functionality. They can then later build additional functionality on top of it, or make a modification to the project based on their requirements, e.g., business logic. Once it’s distributed, an unmanaged package cannot be upgraded.

    Managed packages are typically built by Salesforce ISV partners to sell and distribute their applications to customers. These packages are created from Salesforce Developer Edition organizations. Managed packages are fully upgradable. The customer installing the package cannot see or make changes to Apex code that is part of a managed package.

  • Deepak

    Member
    August 14, 2019 at 7:54 am in reply to: What is the use of setStorable in Aura framework?

    Storable Actions are a GREAT way to enhance the performance of your Lightning components and implementing them is incredibly easy, but there is one big gotcha to seeing them work with a stand-alone Lightning Application.

    Even though storable actions are automatically configured in Lightning Experience and Salesforce1, any Stand-alone Lightning apps that are used to host your components will NOT use caching by default.

  • Deepak

    Member
    August 14, 2019 at 7:51 am in reply to: How does Apex handle security and sharing?

    Apex generally runs in system context; that is, the current user's permissions, field-level security, and sharing rules aren’t taken into account during code execution.​ The only exceptions to this rule are Apex code that is executed with the executeAnonymous call and Chatter in Apex. executeAnonymous always executes using the full permissions of the current user. For more information on executeAnonymous, see Anonymous Blocks.

    Although Apex doesn't enforce object-level and field-level permissions by default, you can enforce these permissions in your SOQL queries by using WITH SECURITY_ENFORCED. For more information, see Filter SOQL Queries Using WITH SECURITY_ENFORCED (Beta).

    You can also enforce object-level and field-level permissions in your code by explicitly calling the sObject describe result methods (of Schema.DescribeSObjectResult) and the field describe result methods (of Schema.DescribeFieldResult) that check the current user's access permission levels. In this way, you can verify if the current user has the necessary permissions, and only if he or she has sufficient permissions, you can then perform a specific DML operation or a query.

  • Deepak

    Member
    August 13, 2019 at 3:43 pm in reply to: What is Data Skew in SFDC?

    Data skew can kill performance of your org
    The majority of Salesforce customers will never suffer performance issues in their orgs. However, there are certain configuration patterns which appear again and again, because they are apparently “good ideas”, but which increase the probability of performance issues arising in our Org. These patterns cause inefficient data distributions at the storage layer, technically known as Data Skew. Data Skew problems and are so hard to anticipate and can have such a dramatic impact on performance that they are known by Salesforce as “the silent killer”.

    Perhaps the most common of these patterns is when a single user owns more than 10,000 records of an object. This type of skew is called ownership data skew. In most cases, the customer will not notice any issue even when having this kind of a situation, but there is one particular situation in which the impact on performance of this kind of Data Skew can be very significant.

  • Deepak

    Member
    August 13, 2019 at 3:39 pm in reply to: What is Static Resource in Salesforce?

    Force.com platform provides us a facility to upload, manage and use the content that is static (not changing) for your organization, and it can be stored under “Static Resources“. It can be a Javascript file, CSS file, an image or even a zip file containing all the files required in one zip file.

    You can refer this image in your code using expression {$Resource.Z_Test}. Below are some other examples as well:

    <!-- An image can be referenced like this -->
    <img src="<strong>{!$Resource.Z_Test}</strong>"/>

    <!-- Similarly any CSS file can be referenced like below -->
    <apex:stylesheet value="<strong>{!$Resource.sampleCss}</strong>"/>

  • Deepak

    Member
    August 13, 2019 at 3:15 pm in reply to: What is Database.Stateful in Salesforce Batch Classes?

    Using Stateful Batch Apex
    Batch Apex is stateless by default. That means for each execution of your executemethod, you receive a fresh copy of your object. All fields of the class are initialized, static and instance. If your batch process needs information that is shared across transactions, one approach is to make the Batch Apex class itself stateful by implementing the Stateful interface. This instructs Force.com to preserve the values of your static and instance variables between transactions.

     

  • Deepak

    Member
    August 12, 2019 at 2:46 pm in reply to: How can I relate Activity to a second object in Salesforce?

    SFDC does not allow this currently. You cannot add lookup fields or junction objects to Tasks to enable what you want to do.

    Workaround today include creating your own Task object and recreating Task functionality. This is how Milestones PM Application on AppExchange works.

    Pros:

    You can relate a Task to multiple Objects in the System. Gives you flexibility to cusotmize however you want within confines of Force.com. Formula Fields, Roll Up Summaries, etc.

    Cons:

    You lose ALL the special features of Activities like:

    Outlook Integration Popups (Nag Boxes) for Task Reminders Activities History Rollups on Account Activity Archiving etc.

  • Deepak

    Member
    August 12, 2019 at 2:43 pm in reply to: How to use Apex Repeat with Set Collection in Salesforce?

    You can definitely use a Set in a repeat.

    In the Controller. The property and initializing it in the Constructor, for example's sake:

    public with sharing class TestController {
    public Set<String> aset { get; set; }

    public TestController () {
    aset = new Set<String>{'a','b','c'};
    }
    }

    The Visualforce snippet:

    <apex:repeat value="{!aset}" var="a">
    <apex:outputText value="{!a}"/><br/>
    </apex:repeat>

  • Method marked with @TestSetUp annotation executes before any testMethod.
    Data created in this method doesn’t need to be created again and again, and it is by default available for all test methods.
    There can be only one setup method per test class.
    Test setup methods are supported only with the default data isolation mode for a test class. If the test class or a test method has access to organization data by using the @isTest(SeeAllData=true)annotation, test setup methods aren’t supported in this class

  • Deepak

    Member
    August 9, 2019 at 1:47 pm in reply to: Key Difference between VF pages And Lightning

    VISUALFORCE

    Visualforce follows a Page-Centric model. PageCentric means that the goal of Visualforce is to create something that is your full page interface. When the user has to perform some operation, eg Create a record or save a record, it sends that request to the Salesforce servers and then reloads the entire page with the new state of the UI. All backend processing is done with Apex Code on the Server-Side. You have the option to inject JavaScript into the mix to handle some of the Client-Side processing, but it isn’t the default interaction methodology. Visualforce also primarily built for Desktop. Visualforce generates a new page every time you interact with the application.

    LIGHTING COMPONENT

    It is an App-centric approach. Lightning components are part of the Salesforce user interface framework for developing dynamic web applications for desktop and mobile devices. They use JavaScript at the client-side and Apex at the server-side to provide the data and business logic.

  • Deepak

    Member
    August 9, 2019 at 5:15 am in reply to: Can we iterate over SET in salesforce ?

    Using for loop we can easily iterate over all the elements of set.

    for example-

    for (variable : list_or_set) {
    code_block
    }

  • The @AuraEnabled annotation enables client- and server-side access to an Apex controller method. Providing this annotation makes your methods available to your Lightning components (both Lightning web components and Aura components). Only methods with this annotation are exposed.

    In API version 44.0 and later, you can improve runtime performance by caching method results on the client by using the annotation @AuraEnabled(cacheable=true). You can cache method results only for methods that retrieve data but do not modify it. Using this annotation eliminates the need to call setStorable() in JavaScript code on every action that calls the Apex method.

  • It is very simple you have to write "global with sharing" before your class, the class which you want to call.

    for example

    global with sharing class Addrec{
    public static void add(string name){
    account acc=new account();
    acc.name=name;
    insert acc;
    }
    }

    now calling will be like

    global with sharing class callfun {
    public List<Account> getres() {
    Addrec x = new Addrec();
    return x.add(string name);
    }
    }

    • This reply was modified 5 years, 3 months ago by  Deepak.
Page 8 of 8