Forum Replies Created

Page 44 of 57
  • shariq

    Member
    September 15, 2018 at 5:25 pm in reply to: What is a use case for Salesforce Connect in Salesforce?

    Hi,

    I recommend that you use Salesforce Connect if most of these conditions apply.

    • You have a large amount of data that you don’t want to copy into your Salesforce org.
    • You need small amounts of data at any one time.
    • You need real-time access to the latest data.
    • You store your data in the cloud or in a back-office system, but want to display or process that data in your Salesforce org.

    Hope this helps.

  • Hi,

    Please find the realtime scenario where there is a chance of recursive trigger occurs.

    For example -

    We have a Location object with Active as a field which will maintain whether the Location is a Active or not.

    Scenario 1:

    If the user is inserting a new Location with Active flag is true, it will check all the existing active Location with the matching name and try to de-activate them.

    Scenario 2:
    If the user is update the existing Location with Active flag is true, it will check all the existing active Location with the matching name and try to de-activate them.

    Here we have to write a Trigger on the Location object with after insert, after update as a events.

    Possible issues:

    If we are not adding the conditions properly then there is a chance of getting into recrussive calls. Hence we have to follow below steps:

    (1) Make sure that all the possible conditions are added properly so that it will not recursively.

    (2) At times we may need to use Static variable to control the recursive calls.

    Note: This is one of the possible reasons and there may be multiple other reasons where the recursive trigger execution happens.

    Here is another relatime scenario for you:

    Whenever the user updates an Account, also update the corresponding Contacts. At the same time, if user is touching the Contacts, update the Accounts.

    Here also highly possibility of recursive trigger execution happens.

    Note: I could have copied lot of best practices but, explaining with the realtime scenarios will help you understand in a better way, hence providing all these points. But don't forget to follow all the possible best practices whenever you are writing Apex Code / Visualforce Page.

    Hope this helps.

  • shariq

    Member
    September 15, 2018 at 5:16 pm in reply to: What is a resource in Restful web services in Salesforce?

    Hi,

    For more clarity -

    You can expose your Apex class and methods so that external applications can access your code and your application through the REST architecture. This is done by defining your Apex class with the @RestResource annotation to expose it as a REST resource. Similarly, add annotations to your methods to expose them through REST. For example, you can add the @HttpGet annotation to your method to expose it as a REST resource that can be called by an HTTP GET request.

    Six new annotations have been added that enable you to expose an Apex class as a RESTful Web service.@RestResource(urlMapping='/yourUrl')
    @HttpDelete
    @HttpGet
    @HttpPatch
    @HttpPost
    @HttpPut

    Hope this helps.

  • shariq

    Member
    September 15, 2018 at 5:10 pm in reply to: Does trigger.oldmap change during recursion in Salesforce?

    Hi,

    To explain more -

    Let me explain it with an example. Let say you have a requirement where you want to save the previoues owner of an account when the account owner is changed. You understand that you need to create a  trigger on update for account. Let say you click edit button and the owner is abc. Now you need to check that if owner is changed whehter it is defferent from previuos one.Here comes the need of trigger.oldmap. You check that if the  new entered owner let say xyz is same of diffrent from the previous owner. You can do that trigger.oldmap.account.owner(abc)== trigger.newmap.account.owner (xyz)..(just an example as this is not the right way to access account owner field).

     

    In the above example, you can make out that oldmap and newmap is used to compare the  old and new versions of Sobject records.

    Hope this helps.

  • shariq

    Member
    September 15, 2018 at 5:06 pm in reply to: Can we use Workflow Rules with Time Triggers in Salesforce?

    Hi,

    Time Trigger Processing

    • Time-dependent actions aren’t executed independently. They’re grouped into a single batch that starts executing within one hour after the first action enters the batch.
    • Apex triggers that fire as a result of time-dependent actions may get executed in a single batch or independently. Follow these best practices:
      • In case they fire independently–Ensure that your Apex logic is scoped for a single scheduled action. For example, don't use Apex static variables to communicate state across Apex code triggered by different scheduled actions.
      • In case they fire in a single batch–Be aware of how the combination of your time-dependent actions and Apex triggers impact your Apex governor limits.
    • Salesforce evaluates time-based workflow on the organization’s time zone, not the user’s. Users in different time zones might see differences in behavior.
      Salesforce doesn’t necessarily execute time triggers in the order they appear on the workflow rule detail page. Workflow rules list time triggers that use the Before field first, followed by time triggers that use the After field.
    • Salesforce doesn't display time-dependent action controls on the workflow rule edit page if you set the workflow rule evaluation criteria to Evaluate the rule when a record is: created, and any time it’s edited to subsequently meet criteria.
    • If you change a date field that is referenced by an unfired time trigger in a workflow rule that has been evaluated, Salesforce recalculates the unfired time triggers associated with the rule. For example, if a workflow rule is scheduled to alert the opportunity owner 7 days before the opportunity close date and the close date is set to 2/20/2011, Salesforce sends the alert on 2/13/2011. If the close date is updated to 2/10/2011 and the time trigger hasn't fired, Salesforce reschedules the alert for 2/3/2011. If Salesforce recalculates the time triggers to a date in the past, Salesforce triggers the associated actions shortly after you save the record.
    • If a workflow rule has a time trigger set for a time in the past, Salesforce queues the associated time-dependent actions to start executing within one hour. For example, if a workflow rule on opportunities is configured to update a field 7 days before the close date, and you create an opportunity record with the close date set to today, Salesforce starts to process the field update within an hour after you create the opportunity.
    • Time-dependent actions remain in the workflow queue only as long as the workflow rule criteria are still valid. If a record no longer matches the rule criteria, Salesforce removes the time-dependent actions queued for that record.For example, an opportunity workflow rule can specify:
      • A criteria set to “Opportunity: Status not equals to Closed Won, Closed Lost”
      • An associated time-dependent action with a time trigger set to 7 days before the opportunity close date
        If a record that matches the criteria is created on July 1 and the Close Date is set to July 30, the time-dependent action is scheduled for July 23. However, if the opportunity is set to “Closed Won” or “Closed Lost” before July 23, the time-dependent action is removed from the queue.
    • Salesforce ignores time triggers that reference null fields.
    • Time-dependent actions can automatically be queued again if the record is updated and the evaluation criteria is set to Evaluate the rule when a record is: created, and any time it’s edited to subsequently meet criteria. Using the previous example, if the opportunity status is changed from Closed Lost to Prospecting and the workflow rule evaluation criteria is Evaluate the rule when a record is: created, and any time it’s edited to subsequently meet criteria, Salesforce reevaluates the time triggers and adds the appropriate actions to the workflow queue.
    • Deleting a record that has pending actions removes the pending actions from the workflow queue. You can't restore the actions, even if you undelete the record.
    • If the evaluation criteria is set to Evaluate the rule when a record is: created, the workflow rule evaluates its time triggers only once. If the record that fired the rule changes to no longer meet the evaluation criteria, Salesforce removes the pending actions from the queue and never reapplies the rule to the record.
    • You can deactivate a workflow rule at any time. If the rule has pending actions in the workflow queue, editing the record that triggered the rule removes the pending actions from the queue. If you don't edit the record, the pending actions are processed even though the rule has been deactivated.
    • Time-dependent actions aren't executed for a reevaluated workflow rule in the following situations:
      • The reevaluated workflow rule’s immediate actions cause the record to no longer meet the workflow rule criteria.
      • An Apex after trigger that is executed as a result of a workflow or approvals action causes the record to no longer meet the workflow rule criteria.
    • Configuring a task’s Due Date to “Rule Trigger Date” sets time triggers and workflow task due dates based on the date that the workflow time trigger’s action is executed. For example, if the task due date is “Rule Trigger Date plus 10 days” and the time trigger is executed on January 1, Salesforce sets the task due date to January 11.
    • You can add a new active workflow rule with time triggers in a change set and deploy it. You can only change time triggers on a workflow rule in a change set if it's inactive. The rule must be activated in the destination organization manually or through another change set that only activates workflow rules and makes no time trigger changes.For example, let’s say you have an inactive workflow rule in your destination organization, and your change set contains an active workflow rule with the same name and new or different time triggers. The deployment fails because it activates the workflow rule first and then tries to add or remove the time triggers

    Hope this helps.

  • Hi,

    Best way to prevent this is to use Map of Id vs record-

    Map<Id, Sobject> mapIdVsRecords = new Map<Id, Sobject>();

    for(Sobject sobj : sObjectList){

    mapIdVsRecords .put(sobj.Id, sobj);

    }

    Hope this helps.

  • shariq

    Member
    September 15, 2018 at 2:10 pm in reply to: What is the return type of Trigger.Old and Trigger.OldMap in Salesforce?

    Hi,

    Trigger.old - It returns a list of sobject records.

    Trigger.oldMap - It returns a map of Id vs Sobject record.

    Hope this helps.

  • shariq

    Member
    September 15, 2018 at 2:08 pm in reply to: Is it possible to create trigger on views in Salesforce?

    Hi,

    You can create triggers on sobjects but not on list views of sobject.

    Hope this helps.

  • shariq

    Member
    September 15, 2018 at 2:06 pm in reply to: Can a trigger make a call to Salesforce Apex callout method?

    Hi,

    Callout is a Asynchronous process where as Trigger is Dynamic / Synchronous.

    That means it is not directly possible to do a webservice  callout from a trigger.

    But using @Future annotation we can convert the Trigger into a Asynchrinous Class and we can use a Callout method.

    See the links below for some more information ,

    You can invoke callouts from triggers by encapsulating the callouts in @future methods

    Hope this helps.

  • shariq

    Member
    September 15, 2018 at 2:04 pm in reply to: What is the use of httpPATCH in Salesforce?

    Hi,

    HttpPatch methods are used to do update operation in salesforce. You have to write class with @httpPatch method which will be used by end user.

    Please refer this:

    @RestResource(urlMapping='/jaichaturvedirestexample/*')
    global with sharing class RESTClass{

    @HttpPatch //use patch for updating record in database. we have to pass record id to fecth it from database and then update it.
    global static String updateAccount(string accnumber){
      String accid1 = RestContext.request.params.get('id');
      Account acc = [select accountnumber from account where id =: accid1];
      acc.accountnumber = accnumber;
      update acc;
      return 'account updated';
    }

    }

    Here end user have to pass account number ot update account record.

    Hope this helps.

  • shariq

    Member
    September 15, 2018 at 2:01 pm in reply to: What are the different types of collections in Salesforce Apex?

    Hi,

    Lists
    List can contain any number of records of primitive, collections, sObjects, user defined and built in Apex type. This is one of the most important type of collection and also, it has some system methods which have been tailored specifically to use with List. List index always starts with 0. This is synonymous to the array in Java. A list should be declared with the keyword 'List'.

    Example

    Below is the list which contains the List of a primitive data type (string), that is the list of cities.

     

    List<string> ListOfCities = new List<string>();
    System.debug('Value Of ListOfCities'+ListOfCities);
    Declaring the initial values of list is optional. However, we will declare the initial values here. Following is an example which shows the same.

    List<string> ListOfStates = new List<string> {'NY', 'LA', 'LV'};
    System.debug('Value ListOfStates'+ListOfStates);

    Sets
    A Set is a collection type which contains multiple number of unordered unique records. A Set cannot have duplicate records. Like Lists, Sets can be nested.

    Example

    We will be defining the set of products which company is selling.

    Set<string> ProductSet = new Set<string>{'Phenol', 'Benzene', 'H2SO4'};
    System.debug('Value of ProductSet'+ProductSet);

    Maps
    It is a key value pair which contains the unique key for each value. Both key and value can be of any data type.

    Example

    The following example represents the map of the Product Name with the Product code.

    // Initialize the Map
    Map<string, string> ProductCodeToProductName = new Map<string, string>
    {'1000'=>'HCL', '1001'=>'H2SO4'};

    // This statement would give as output as key value pair in Debug log
    System.debug('value of ProductCodeToProductName'+ProductCodeToProductName);

    Hope this helps.

  • shariq

    Member
    September 15, 2018 at 1:50 pm in reply to: How can I increase the Standard Date field year Range in Visualforce?

    Hi,

    I found this online -

    Hope this helps.

  • shariq

    Member
    September 15, 2018 at 1:47 pm in reply to: What is the lifecycle of an application in Salesforce?

    Hi,

    The following steps will very clearly demonstrate the entire Salesforce Development Lifecycle:

    1. Setting Up Source Control Repository: It is always beneficial in the long run from a development point of view to have a separate Git repository for every project, with a default branch acting as the Master branch. It is will be more suited to the purpose of storing the production metadata in the master branch.

    As discussed above there are a number of actors involved during the entire lifecycle of the development. Release Manager helps to create entirely different branches for different features which are supposedly handled by different developers. He/She also helps in creating package.xml manifest while also using the same to populate the Master Branch with Metadata and very rightfully uses Force.com Migration to migrate all the data.

    2. Development Phase: There is this concept of sandboxes in Salesforce. Sandboxes are totally isolated from your Salesforce production, so it implies that the operations that you perform in your sandboxes don’t affect your main Salesforce production enterprise, and vice versa. The developers start coding in their own sandboxes.

    They use Force.com IDE to make connection with their sandboxes and thereby retrieve the matadata from sandbox to the IDE. They do the necessary coding and after performing initial level of unit testing they commit the code to the Git repository.

    For subsequent development this fresh code that has been committed is migrated to their sandboxes and they continue with further development. After completion commit the latest development to the repository.

    But there can be a possibility that two or more people are working on the same code, hence they definitely have to check for any possible conflicts before committing their code.

    3. Testing: As the normal software development lifecycle flows, so is this here in this case. After the development is over it is time for testing. Similar to the developers the testers or QAs also create their own sandboxes and migrate the code to be tested from the repository to their sandboxes.

    Sometimes the QA might be assigned with the task of testing only a particular feature. In such a case they use Partial Copy Sandboxes. They deploy only selected features and allows specialized testing of the app features.

    QA members can also share their sandboxes if situation demands for a more thorough testing of vital and crucial features but it largely depends on the organization’s workflow pattern.However any changes suggested at this level would take it back to the prior phase of development.

    4. Acceptance Testing: After this level of testing is completed it goes for further user acceptance testing. Apart from the QAs and tester the developers, product manager and other parties concerned will perform the final level of testing.

    The release manager at first creates partial sandboxes for testing and the same are used by the product managers to carry out the ad hoc testing. And then he/she prepares the final presentation for the end users or clients. These sandboxes can also be used by the trainers of the company to prepare manuals for the trainees. Again in this phase if any further changes are suggested it goes back to the development phase to inculcate the necessary changes.

    5. Product Release: The last phase is all about performance testing. This testing is performed on intermediate sandboxes which unlike partial sandboxes has all the features of the app.The testing team performs rigorous testing and regression testing. After it passes all levels of testing then it is successfully deployed in the production environment.

    However it is always expected that some or the other important changes will definitely crop up after the final deployment. These end moment changes are handled in the patch releases. Patch cycle has a lifecycle of it’s own but it is quite faster process than the normal development cycle.

    Hope this helps.

  • shariq

    Member
    September 15, 2018 at 1:45 pm in reply to: Why do we use extensions while creating the Salesforce Visualforce Page?

    Hi,

    Basically to override the standard functionality or to add some new functionality.

    Hope this helps.

  • Hi,

    List Custom Settings: A type of custom setting that provides a reusable set of static data that can be accessed across your organization.
    Hierarchy Custom Settings: A type of custom setting that uses a built-in hierarchical logic that lets you personalize settings for specific profiles or users.

    Hope this helps.

  • Hi,

    Pros :
    • Fast & easy to implement and does not require APEX
    • Can be configured on the fly
    • Uses can enable/disable readily

    Cons:
    • Users cannot control order in which field updates are made
    • Performs a subsequent update on a record, which may cause triggers to fire again.

    Hope this helps.

  • shariq

    Member
    September 15, 2018 at 1:34 pm in reply to: Unable to see newly created fields in my Custom Report Type in Salesforce

    Hi,

    Just add them to the page layout to make it visible on Report Editor.

    Hope this helps.

  • Hi,

    For more understanding -

    An external ID is a custom field that has the External ID attribute, meaning that it contains unique record identifiers from a system outside of Salesforce.

    Maximum number of External IDs per object or entity. You can designate up to 25 External ID fields per object. External ID fields must be Custom text, number or email fields. External ID fields contain record IDs from systems outside Salesforce

    Hope this helps.

  • shariq

    Member
    September 15, 2018 at 1:28 pm in reply to: what is the difference between system mode and user mode?

    Hi,

    To make it more simple -

    User Mode - Profile level permissions, field-level security, and sharing rules of the current user are enforced.

    System Mode - Object permissions, field-level security, sharing rules aren't applied for the current user.

    Hope this helps.

    • This reply was modified 6 years, 3 months ago by  shariq.
  • Hi,

    Unmanaged packages
    Unmanaged packages are typically used to distribute open-source projects or application templates to provide developers with the basic building blocks for an application. Once the components are installed from an unmanaged package, the components can be edited in the organization they are installed in. The developer who created and uploaded the unmanaged package has no control over the installed components, and can't change or upgrade them. Unmanaged packages should not be used to migrate components from a sandbox to production organization. Instead, use Change Sets.

    Managed packages

    Managed packages are typically used by salesforce.com partners to distribute and sell applications to customers. These packages must be created from a Developer Edition organization. Using the AppExchange and the License Management Application (LMA), developers can sell and manage user-based licenses to the app. Managed packages are also fully upgradeable. To ensure seamless upgrades, certain destructive changes, like removing objects or fields, can not be performed.
    Managed packages also offer the following benefits:
    Intellectual property protection for Apex
    Built-in versioning support for API accessible components
    The ability to branch and patch a previous version
    The ability to seamlessly push patch updates to subscribers
    Unique naming of all components to ensure conflict-free installs

    Hope this helps.

  • shariq

    Member
    September 15, 2018 at 1:24 pm in reply to: What are the benefits of Salesforce CRM?

    Hi,

    Here are some -

    1. Save Time
    If your company is just now implementing or changing CRM systems, it may seem like CRM is more time consuming than the last system. Many employees may complain about the seeming increase in workload and data entry. What seems like a lot of time spent entering data on CRM, however, will prove to be a monumental time-saver in the not-so-distant future. Cloud CRM systems are especially productive because field reps can update their CRM on-the-go from any mobile device. Salesforce Cloud CRM users see a 40 percent increase in their sales productivity. Sending emails and viewing LinkedIn profiles directly from your CRM are some time-saving features of Salesforce Lightning, for example.

    2. Motivate Employees
    Many CRM systems allow users to set and track goals. Advanced graphics in CRM programs like Salesforce tell the story of the sales through the pipeline. These features allow users to see the percentage of goals met, determine where tasks need to be concentrated, and predict future results.

    3. Identify Trends as They Happen
    Any sales data can show a broad picture of sales and product trends. Usually, however, those trends don’t become apparent until reports are run at the end of a period. With CRM data, your company can see subtle shifts in the marketplace. Perhaps a certain region or demographic is showing a product preference? CRM lets you see these emerging trends and shift sales and marketing messages to capture the sales. Cloud CRM applications are particularly helpful in spotting trends because the data is available to any device with an internet connection.

    4. Calculate Commission
    When asked, most accounting departments will admit they calculate sales reps’ compensation with accounting software or on a spreadsheet. However, many CRM programs can easily calculate compensation. In CRM Magazine (2010) Jim Dickie asserts that companies using CRM for customers should also be using CRM to help keep track of sales reps’ compensation packages. Dickie, a partner at CSO Insights, notes that most firms don’t use their CRM for compensation but should: “If compensation plans are truly meant to drive selling behavior, then we need to upgrade the systems we use to manage these plans. Because of this, I expect to see many more companies migrate their compensation management tasks onto CRM applications,” explains Dickie (2).

    Salesforce offers compensation management apps from its AppExchange (a marketplace of apps that easily integrate into your CRM platform) such as the “Commissions Calculator” app. Use of this app results in time savings and higher productivity for both sales and accounting departments.

    5. Create Business Strategy
    Smart business leaders realize that CRM is not only for the sales department, but for the entire company. Because CRM tracks so many tasks crucial to business operations, CRM should be at the core of every decision. Marketing, scheduling, inventory, human resources, production, forecasting and accounting are all dependent on information from the system. As businesses learn to garner information from their CRM system, they find their business making better, data-driven decisions.

    6. Improve Internal Processes
    CRM systems can to ensure orders are delivered to the customer as promised. Denis Pombriant, CRM analyst and author of The Subscription Economy, explains that CRM-based processes aid in exceptional delivery of products. “Modern CRM, which uses analytics and a decent model of customer behavior, can spot exceptions…[and] gives a vendor the ability to zero in on customers who really need help and at the same time helps manage scarce resources,” explains Pombriant (3).

    This process leads to delivery of what the customer needs. Pombriant continue to explain that following clear processes informed by a CRM tool leads to sales goals without undue complications: “The power of a process orientation is that it leads naturally to the [sale], but in an orderly way that keeps the customer involved and prevents skipping steps that can later come back to haunt.” Helping to define processes is an important benefit of CRM systems.

    7. Identify At-Risk Customers
    Because most sales come from current customers, it’s important to track each customer and their history so your company exceeds their expectations. A CRM tool can help identify customers who have called with several complaints, placed fewer orders than expected or let more time than usual lapse between orders---all red-flags for dissatisfied customers. By proactively contacting these customers, relationships can be strengthened and potential problems resolved.

    8. Create a Customer-Centric Focus
    The name “customer relationship management” should say it all. With CRM software systems, customer information, orders, conversations, and help desk requests can be logged. When talking with a customer, you can access all this information so a conversation with a customer can go smoothly (and pick up where you last left off). Having all the information in the same place allows company representatives to focus on the customer, rather than trying to recall facts and interactions.

    CRM systems, when used well, allow you to more easily focus your business on the customer. By organizing customer data and presenting it in a way that allows for action, CRMs are a necessity for modern sales teams.

    Sales, marketing, purchasing, inventory and customer service should all operate with the customer as the center of their processes. This transformative philosophy will ensure your company takes care of who matters most in your business. The most important benefit of a CRM system is to remind you every time you log on to the CRM program that it’s the customer who’s at the heart of your business.

    Hope this helps.

  • shariq

    Member
    September 15, 2018 at 1:19 pm in reply to: What is Lightning Data Service (LDS)? What are the benefits of using LDS?

    Hi,

    Use Lightning Data Service to load, create, edit, or delete a record in your component without requiring Apex code. Lightning Data Service handles sharing rules and field-level security for you. In addition to not needing Apex, Lightning Data Service improves performance and user interface consistency.
    At the simplest level, you can think of Lightning Data Service as the Lightning Components version of the Visualforce standard controller. While this statement is an over-simplification, it serves to illustrate a point. Whenever possible, use Lightning Data Service to read and modify Salesforce data in your components.

    Data access with Lightning Data Service is simpler than the equivalent using a server-side Apex controller. Read-only access can be entirely declarative in your component’s markup. For code that modifies data, your component’s JavaScript controller is roughly the same amount of code, and you eliminate the Apex entirely. All your data access code is consolidated into your component, which significantly reduces complexity.

    Lightning Data Service provides other benefits aside from the code. It’s built on highly efficient local storage that’s shared across all components that use it. Records loaded in Lightning Data Service are cached and shared across components. Components accessing the same record see significant performance improvements, because a record is loaded only once, no matter how many components are using it. Shared records also improve user interface consistency. When one component updates a record, the other components using it are notified, and in most cases, refresh automatically.

    Hope this helps.

  • shariq

    Member
    September 15, 2018 at 1:17 pm in reply to: What Is a Bucket Field In Salesforce Reports?

    Hi,

    Bucket field in Salesforce Reports is an incredible powerful functionality used to quicklyvcategorize values for a field in a report without the need to have a custom formula field at the object level.

    Hope this helps.

  • Hi,

    You can only have roll up summary field in case of master detail relationship and not in lookup case.

    Hope this helps.

  • shariq

    Member
    September 15, 2018 at 1:11 pm in reply to: What is the use of @testsetup annotation in a test class?

    Hi,

    To add more into this -

    You can have only one test setup method per test class. If a fatal error occurs during the execution of a test setup method, such as an exception that's caused by a DML operation or an assertion failure, the entire test class fails, and no further tests in the class are executed.

    Hope this helps.

Page 44 of 57