Forum Replies Created

Page 48 of 57
  • Hi,

    To make it more simple-

    Top-down means you start with a WSDL and then create all the necessary scaffolding  all the way down.

    Bottom-up means you start with a your method, and generate the WSDL from it.

    Hope this helps.

  • shariq

    Member
    September 14, 2018 at 9:40 pm in reply to: What are some points to remember regarding Static Keyword in apex.

    Hi,

    To add more -

    A static method is used as a utility method, and it never depends on the value of an instance member variable. Because a static method is only associated with a class, it can't access the instance member variable values of its class. A static variable isstatic only within the scope of the Apex transaction.

    Hope this helps.

  • shariq

    Member
    September 14, 2018 at 9:36 pm in reply to: What is a Workflow Alert in Salesforce?

    Email alert is one of the action used in workflow and approval. They are used to generate email template by a workflow rule or approval process and sent to destination recipients. We can send workflow email alerts to users, contacts having an valid email address.

  • shariq

    Member
    September 14, 2018 at 9:34 pm in reply to: Explain Standard and Custom Reports in Salesforce

    Hi,

    Standard Reports. A Standard Report presents what we believe is the most important data for any given domain, subdomain or URL in our index, including your own website or that of a competitor. The Standard Report has three main sections - an overview, a backlinks view, and an anchor text view.

    Custom Report. A Custom Report is a report that you create. You pick the dimensions (City and Browser, for example) and metrics (Sessions, Pageviews, and Bounce Rate, for example) and decide how they should be displayed. You must specify at least one dimension and one metric.

    Hope this helps.

  • shariq

    Member
    September 14, 2018 at 1:09 pm in reply to: What is Dynamic Apex in Salesforce?

    Hi,

    Dynamic Apex enables developers to create more flexible applications by providing them with the ability to:

    Access sObject and field describe informationDescribe information provides metadata information about sObject and field properties. For example, the describe information for an sObject includes whether that type of sObject supports operations like create or undelete, the sObject's name and label, the sObject's fields and child objects, and so on. The describe information for a field includes whether the field has a default value, whether it is a calculated field, the type of the field, and so on.

    Note that describe information provides information about objects in an organization, not individual records.
    Access Salesforce app informationYou can obtain describe information for standard and custom apps available in the Salesforce user interface. Each app corresponds to a collection of tabs. Describe information for an app includes the app’s label, namespace, and tabs. Describe information for a tab includes the sObject associated with the tab, tab icons and colors.
    Write dynamic SOQL queries, dynamic SOSL queries and dynamic DMLDynamic SOQL and SOSL queries provide the ability to execute SOQL or SOSL as a string at runtime

    Hope this helps!

  • shariq

    Member
    September 14, 2018 at 1:07 pm in reply to: What are context variables in Salesforce Triggers?

    Hi,

    All triggers define implicit variables that allow developers to access run-time context. These variables are contained in the System.Trigger class.

    Variable

    isExecuting
    Returns true if the current context for the Apex code is a trigger, not a Visualforce page, a Web service, or an executeanonymous() API call.
    isInsert
    Returns true if this trigger was fired due to an insert operation, from the Salesforce user interface, Apex, or the API.
    isUpdate
    Returns true if this trigger was fired due to an update operation, from the Salesforce user interface, Apex, or the API.
    isDelete
    Returns true if this trigger was fired due to a delete operation, from the Salesforce user interface, Apex, or the API.
    isBefore
    Returns true if this trigger was fired before any record was saved.
    isAfter
    Returns true if this trigger was fired after all records were saved.
    isUndelete
    Returns true if this trigger was fired after a record is recovered from the Recycle Bin (that is, after an undelete operation from the Salesforce user interface, Apex, or the API.)
    new
    Returns a list of the new versions of the sObject records.This sObject list is only available in insert, update, and undelete triggers, and the records can only be modified in before triggers.
    newMap
    A map of IDs to the new versions of the sObject records.This map is only available in before update, after insert, after update, and after undeletetriggers.
    old
    Returns a list of the old versions of the sObject records.This sObject list is only available in update and delete triggers.
    oldMap
    A map of IDs to the old versions of the sObject records.This map is only available in update and delete triggers.
    size
    The total number of records in a trigger invocation, both old and new.

    Hope this helps!

  • shariq

    Member
    September 14, 2018 at 12:25 pm in reply to: What is the use of HTTP POST in Salesforce?

    Hi,

    Making your Apex class available as a REST web service is straightforward. Define your class as global, and define methods as global static. Add annotations to the class and methods. For example, this sample Apex REST class uses one method. The createRecord method is a custom REST API call. It’s annotated with @HttpPost and is invoked for a POST request.

    @RestResource(urlMapping='/Account/*')
    global with sharing class MyRestResource {
    @HttpPost
    global static Account createRecord() {
    // Add your code
    }
    }

    Hope this helps!

  • shariq

    Member
    September 14, 2018 at 12:20 pm in reply to: What is the use of AuraEnabled Annotation in Salesforce?

    Hi,

    The AuraEnabled annotation provides support for Apex methods and properties to be used with the Lightning Component framework.
    The AuraEnabled annotation is overloaded, and is used for two separate and distinct purposes.

    Use @AuraEnabled on Apex class static methods to make them accessible as remote controller actions in your Lightning components.
    Use @AuraEnabled on Apex instance methods and properties to make them serializable when an instance of the class is returned as data from a server-side action.

    Hope this helps!

  • Hi,

    RESTful Web Service should not keep a client state on the server. This restriction is called Statelessness. It is the responsibility of the client to pass its context to the server and then the server can store this context to process the client's further request. For example, session maintained by server is identified by session identifier passed by the client.

    Following are the benefits of statelessness in RESTful Web Services −

    Web services can treat each method request independently.
    Web services need not maintain the client's previous interactions. It simplifies the application design.
    As HTTP is itself a statelessness protocol, RESTful Web Services work seamlessly with the HTTP protocols.

    Hope this helps!

  • Hi,

    Apex offers two ways to perform DML operations: using DML statements or Database class methods. This provides flexibility in how you perform data operations. DML statements are more straightforward to use and result in exceptions that you can handle in your code.

    One difference between the two options is that by using the Database class method, you can specify whether or not to allow for partial record processing if errors are encountered. You can do so by passing an additional second Boolean parameter. If you specify false for this parameter and if a record fails, the remainder of DML operations can still succeed. Also, instead of exceptions, a result object array (or one result object if only one sObject was passed in) is returned containing the status of each operation and any errors encountered. By default, this optional parameter is true, which means that if at least one sObject can’t be processed, all remaining sObjects won’t and an exception will be thrown for the record that causes a failure.

    The following helps you decide when you want to use DML statements or Database class methods.

    Use DML statements if you want any error that occurs during bulk DML processing to be thrown as an Apex exception that immediately interrupts control flow (by using try. . .catch blocks). This behavior is similar to the way exceptions are handled in most database procedural languages.
    Use Database class methods if you want to allow partial success of a bulk DML operation—if a record fails, the remainder of the DML operation can still succeed. Your application can then inspect the rejected records and possibly retry the operation. When using this form, you can write code that never throws DML exception errors. Instead, your code can use the appropriate results array to judge success or failure. Note that Database methods also include a syntax that supports thrown exceptions, similar to DML statements.

    Hope this helps!

  • shariq

    Member
    September 14, 2018 at 12:08 pm in reply to: How many Controllers can be used on a single Salesforce visualforce Page?

    Hi,

    You can have the two controller functionality in one visualforce page by using standard controller and extension. So in extension you can mention the name of multiple controller from which you want to access the functionality of these controller . For example:-

    VisualForce page:-

    <apex:page standardController=”Account”
    extensions=”ExtOne,ExtTwo” showHeader=”false”>
    <apex:outputText value=”{!foo}” />
    </apex:page>

    Extension Class:-

    ExtOne:-

    public class ExtOne {
    public ExtOne(ApexPages.StandardController acon) { }

    public String getFoo() {
    return ‘foo-One’;
    }
    }

    ExtTwo:-

    public class ExtTwo {
    public ExtTwo(ApexPages.StandardController acon) { }

    public String getFoo() {
    return ‘foo-Two’;
    }
    }

    Hope this helps!

  • shariq

    Member
    September 14, 2018 at 12:07 pm in reply to: Is there any limit on number of triggers defined on an object?

    Hi,

    Every Salesforce org with a strong development team always has just one trigger per object!. It’s exactly as it sounds! You combine all possible triggers on a specific object into just one trigger. Instead of creating many triggers for an object combined all your scenarios in a single trigger.

     

  • shariq

    Member
    September 14, 2018 at 12:02 pm in reply to: What are the different methods in Salesforce Batch Apex class?

    Hi,

    The Database.Batchable interface contains three methods that must be implemented.

    Start method :

    global (Database.QueryLocator | Iterable<sObject>) start(Database.BatchableContext bc) {}

    To collect the records or objects to pass to the interface method execute, call the start method at the beginning of a batch Apex job. This method returns either a Database.QueryLocator object or an iterable that contains the records or objects passed to the job.

    execute method: 

    global void execute(Database.BatchableContext BC, list<P>){}

    To do the required processing for each chunk of data, use the execute method. This method is called for each batch of records that you pass to it.

    This method takes the following:A reference to the Database.BatchableContext object.
    A list of sObjects, such as List<sObject>, or a list of parameterized types. If you are using a Database.QueryLocator, use the returned list.

    finish method: 

    global void finish(Database.BatchableContext BC){}

    To send confirmation emails or execute post-processing operations, use the finish method. This method is called after all batches are processed.

    Hope this helps!

  • shariq

    Member
    September 14, 2018 at 11:59 am in reply to: What Is Property in Salesforce Apex?

    Hi,

    An Apex property is similar to a variable.

    Property definitions include one or two code blocks, representing a get accessor and a set accessor:

    The code in a get accessor executes when the property is read.
    The code in a set accessor executes when the property is assigned a new value.

    Note the following:

    The body of the get accessor is similar to that of a method. It must return a value of the property type. Executing the get accessor is the same as reading the value of the variable.
    The get accessor must end in a return statement.
    We recommend that your get accessor not change the state of the object that it is defined on.
    The set accessor is similar to a method whose return type is void.
    When you assign a value to the property, the set accessor is invoked with an argument that provides the new value.
    When the set accessor is invoked, the system passes an implicit argument to the setter called value of the same data type as the property.
    Properties cannot be defined on interface.

    Hope this helps!

  • shariq

    Member
    September 14, 2018 at 11:55 am in reply to: In how many ways we can invoke the Salesforce Apex Class?

    Hi,

    Apex invoking refers to the process of executing the Apex class. Apex class can only be executed when it is invoked via one of the ways listed below −

    Triggers and Anonymous block
    A trigger invoked for specified events
    Asynchronous Apex
    Scheduling an Apex class to run at specified intervals, or running a batch job
    Web Services class
    Apex Email Service class
    Apex Web Services, which allow exposing your methods via SOAP and REST Web services
    Visualforce Controllers
    Apex Email Service to process inbound email
    Invoking Apex Using JavaScript
    The Ajax toolkit to invoke Web service methods implemented in Apex

    Hope this helps!

  • shariq

    Member
    September 14, 2018 at 11:53 am in reply to: What is the use of Savepoint in Salesforce Apex?

    Hi,

    Database.savepoint is a method which is used to define a point which can be roll back to. If any error occurs during a transaction, that contains many statements, the application will roll back to the most recent savepoint and the entire transaction will not be aborted.

    Hope this helps!

  • Hi,

    Outbound messaging allows you to specify that changes to fields within Salesforce can cause messages with field values to be sent to designated external servers.

    Outbound messaging is part of the workflow rule functionality in Salesforce. Workflow rules watch for specific kinds of field changes and trigger automatic Salesforce actions, such as sending email alerts, creating task records, or sending an outbound message.
    After you set up outbound messaging, when a triggering event occurs, a message is sent to the specified endpoint URL. The message contains the fields specified when you created the outbound message. Once the endpoint URL receives the message, it can take the information from the message and process it. To do that, you need to examine the outbound messaging WSDL.

    Hope this helps!

  • shariq

    Member
    September 14, 2018 at 6:35 am in reply to: When to use before vs after Triggers in Salesforce?

    Hi,

    95% of triggers are before triggers – so if you’re unsure, go with before!

    Hope this helps!

  • shariq

    Member
    September 14, 2018 at 6:31 am in reply to: Can we use SOSL statements in Salesforce triggers?

    Hi,

    Yes, you can write SOSL inside triggers. Below are some points about SOSL :

    SOSL is a search language in salesforce and the important feature is that Unlike SOQL, we can search in multiple objects at same time using SOSL. In SOQL, we can query only one object at a time but in SOSL, We can search for some specified string like ‘testString’ in multiple objects at the same time.

    We can search for some specified string like ‘testString’ in multiple objects at the same time.
    We can mention in which fields of all the sObjects,we want to search for the string specified.
    The SOSL query start with the keyword ‘FIND’.
    You can specify, which fields to return for each object mentioned in SOSL query. Suppose you have performed search on three objects Account, Contact & Opportunity. Then you can mention like, for list returned with Account results only (Name, Industry) fields should be returned, and for Contacts results (firstName, lastName) should be returned and similarly for Opportunity.
    The result of SOSL is a list of lists of sObjects “List<List<sObject>>”.
    The returned result contains the list of sObjects in the same order as order mentioned in SOSL  query.
    If a SOSL query does not return any records for a specified sObject type, then search results include an empty list for that sObject.
    The search string should be at least two characters long.

    Hope this helps !

  • shariq

    Member
    September 14, 2018 at 6:24 am in reply to: Can a Salesforce trigger call a batch class in Salesforce?

    Hi,

    You can call a batch from a trigger, but you need to be aware of potential limits you could hit.

    You can only have 5 batch jobs queued or executing at once. If your trigger calls batch jobs each time, then you could quickly exceed that limit.

    Hope this helps!

  • Hi,

    The following limitations apply to generating savepoint variables and rolling back the database:

    If you set more than one savepoint, then roll back to a savepoint that is not the last savepoint you generated, the later savepoint variables become invalid. For example, if you generated savepoint SP1 first, savepoint SP2 after that, and then you rolled back to SP1, the variable SP2 would no longer be valid. You will receive a runtime error if you try to use it.
    References to savepoints cannot cross trigger invocations because each trigger invocation is a new trigger context. If you declare a savepoint as a static variable then try to use it across trigger contexts, you will receive a run-time error.
    Each savepoint you set counts against the governor limit for DML statements.
    Static variables are not reverted during a rollback. If you try to run the trigger again, the static variables retain the values from the first run.
    Each rollback counts against the governor limit for DML statements. You will receive a runtime error if you try to rollback the database additional times.
    The ID on an sObject inserted after setting a savepoint is not cleared after a rollback. Create an sObject to insert after a rollback. Attempting to insert the sObject using the variable created before the rollback fails because the sObject variable has an ID. Updating or upserting the sObject using the same variable also fails because the sObject is not in the database and, thus, cannot be updated.

    Hope this helps!

  • Hi,

    Render: – Is used to show/hide the particular block, output panel or input/output fields based on the condition.

    Example: – You have 2 fields one is visible and second is hidden, you want the second field to be visible when the first field is filled then use render.

    <apex:pageBlockTable value=”{!empList}” var=”emp” rendered=”{!empList.size > 0}”>
    <apex:column value=”{!emp.Name}”/>
    </apex:pageBlockTable>

    reRerender: – Is used to refresh the particular output panel, block, and or fields after a server request has been completed. It uses Id to reRender.

    Example: – You have a VF page where you want to add Contacts related to Account and also wanted to show the recently added Contacts then use reRender to refresh the block which is showing the contact list.

    renderAs: – Is used to open the Visualforce Page in different format like- HTML, pdf, and excel

    Example: – To show the invoice in PDF format.

    for pdf – renderAs =”pdf”

    for HTML – renderAs =”html”

    for excel – <apex:page controller=”contactquery” contentType=”application/vnd.ms-excel#SalesForceExport.xls” cache=”true”>

    Hope this helps!

  • shariq

    Member
    September 14, 2018 at 5:29 am in reply to: What is community cloud model in Salesforce?

    Hi,

    Community Cloud is a social platform from Salesforce.com that is designed to connect and facilitate communication among an organization's employees, partners and customers.

    Community Cloud employs Salesforce's Chatter social CRM platform for chat and screensharing, allowing users to exchange data and images in real time throughout an ongoing conversation. The platform supports customer relationship management (CRM) and provides channels for customers to find information and communicate with other customers. The console also includes a "Buy" button to enable e-commerce.

    Employees can use the platform for many types of workplace interactions, including troubleshooting, human resources management (HRM) and help desk communications as well as collaboration among geographically dispersed teams. Management can use it to communicate more efficiently with channel partners and other external parties.

    In a generic context, a community cloud is a multi-tenant infrastructure that enables collaboration among several organizations from a specific group with common computing concerns such as regulatory compliance, audit requirements or performance requirements.

    Hope this helps.

  • shariq

    Member
    September 14, 2018 at 5:27 am in reply to: Why is it necessary for most sales teams to use both Leads and Contacts?

    Hi,

    Companies often get overwhelmed with the thought of exerting extra effort in separating leads and contacts. Honestly, this is nothing a quick dialogue between the sales and marketing teams can’t settle.
    Companies from other industries tend to think that the system only fits the B2B business model. But come to think of it, most industries out there come up with their own marketing plans to invite in potential clients, also known as leads.
    The only probably exception would be those businesses with a small to no sales team (i.e. eCommerce companies). Often times, these types focus their marketing efforts into creating only a limited yet loyal clientele.

    Hope this helps.

  • shariq

    Member
    September 14, 2018 at 5:17 am in reply to: What is the best way to deploy profiles in Salesforce?

    Hi,

    The metadata API and the "change set" feature are not "destructive" by nature. Many people think that when you copy a profile, you are copying all of the permissions for that profile, including all object and field permissions. However, this simply isn't true. While you do need to compare base profiles for a comparison of, for example, "API Enabled" or "Export Data", objects and fields are enabled separately by default, which means that you can copy just a subset of all available permissions without worrying about a complete overwrite.

    It is true that you should be wary about using profiles in the Eclipse IDE, and with good reason. The plugin is "smart" and tries to only deploy changes. This means that in order to deploy a change to a field level security item, you have to modify both the profile and the custom field in order for a change to occur. This is usually a huge hassle, and so you should probably avoid doing that.

    Change sets, and the metadata toolkit, however, are perfect ways to copy just the permissions you want to copy. This is because the system will only change the settings relevant to the combination of profiles and fields/objects. The Metadata Toolkit gives you the flexibility of editing raw XML files, allowing you to copy only the information you want to.

    Hope this helps.

Page 48 of 57