Forum Replies Created

Page 37 of 57
  • shariq

    Member
    September 17, 2018 at 11:50 PM in reply to: How to schedule export or take the backup of Salesforce?

    Hi,

    If you would like to have daily cloud-based backups of your Salesforce data, then please take a look at CloudAlly. They provide automated daily online backups of Salesforce (including Chatter), Google Apps and more to unlimited Amazon S3 secure storage.

    Hope this helps.

  • shariq

    Member
    September 17, 2018 at 11:49 PM in reply to: What is the difference between Chatter API and Connect API in Salesforce?

    Hi,

    To add into this more  -

    How Is Chatter REST API Different from Other Salesforce APIs?
    The following are some of the differences between Chatter REST API and REST API:

    • Data is structured for rendering on websites and mobile devices.
    • Returned information is localized to the user's time zone and language.
    • Changed values that are tracked in a feed are returned as value-pair representations.
    • Rate limiting for Chatter REST API is per user, per application, per hour. The rate limiting for SOAP API and REST API is by organization.
    • If needed, extract an ID from the REST API and use it in requests to Chatter REST API.

    Hope this helps.

  • shariq

    Member
    September 17, 2018 at 11:40 PM in reply to: What are Chainset Deployment Sets in Salesforce?

    Hi,

    Just to add Note - 

     For example, you can’t use a change set to upload a list of contact records. Change sets contain information about the org. They don’t contain data, such as records.

    Hope this helps.

  • Hi,

    You can't deploy data or records, you can only deploy meta data example - fields etc.

    Hope this helps.

  • shariq

    Member
    September 17, 2018 at 11:33 PM in reply to: What are the properties inside LoginScopeHeader in Salesforce?

    Hi,

    LoginScopeHeader
    Specifies your organization ID so that you can authenticate Self-Service users for your organization using the existing login().

    Example -

    /// Demonstrates how to set the LoginScopeHeader values.
    public void LoginScopeHeaderSample()
    {
    // Web Reference to the imported Partner WSDL.
    APISamples.partner.SforceService partnerBinding;

    string username = "USERNAME";
    string password = "PASSWORD";

    // The real Client ID will be an API Token provided by salesforce.com
    // to partner applications following a security review. For more details,
    // see the Security Review FAQ in the online help.
    string clientId = "SampleCaseSensitiveToken/100";

    partnerBinding = new SforceService();
    partnerBinding.CallOptionsValue = new CallOptions();
    partnerBinding.CallOptionsValue.client = clientId;

    // To authenticate Self-Service users, we need to set the OrganizationId
    // in the LoginScopeHeader.
    string orgId = "00ID0000OrgFoo";
    partnerBinding.LoginScopeHeaderValue = new LoginScopeHeader();
    partnerBinding.LoginScopeHeaderValue.organizationId = orgId;
    // Specify the Portal ID if the user is a Customer Portal user.
    string portalId = "00ID0000FooPtl";
    partnerBinding.LoginScopeHeaderValue.portalId = portalId;

    try
    {
    APISamples.partner.LoginResult lr =
    partnerBinding.login(username, password);
    }
    catch (SoapException e)
    {
    Console.WriteLine(e.Code);
    Console.WriteLine(e.Message);
    }
    }

    Hope this helps.

  • shariq

    Member
    September 17, 2018 at 11:31 PM in reply to: What are the functionality of bindPopup and containerPoint in the leaflet?

    Hi,

    This is what I found on Leaflet doc -

    bindPopup - It binds a popup to all of the layers at once (likewise with bindTooltip).

    containerPoint  - Pixel coordinates of the point where the mouse event occured relative to the map сontainer.

    Hope this helps.

  • shariq

    Member
    September 17, 2018 at 11:28 PM in reply to: How to export all points within Leaflet polygon in Salesforce?

    Hi,

    I have found this code online, try this and let me know -

    map.on(‘draw:created’, function (e) {
        var type = e.layerType,
        layer = e.layer;
    
        if (type === ‘polygon’) {
            // here you got the polygon points
            var points = layer._latlngs;
    
            // here you can get it in geojson format
            var geojson = layer.toGeoJSON();
        }
        // here you add it to a layer to display it in the map
        drawnItems.addLayer(layer);
    });

    Hope this helps.

  • shariq

    Member
    September 17, 2018 at 11:27 PM in reply to: What are the best practices for Salesforce triggers?

    Hi,

    1) One Trigger Per Object
    A single Apex Trigger is all you need for one particular object. If you develop multiple Triggers for a single object, you have no way of controlling the order of execution if those Triggers can run in the same contexts

    2) Logic-less Triggers
    If you write methods in your Triggers, those can’t be exposed for test purposes. You also can’t expose logic to be re-used anywhere else in your org.

    3) Context-Specific Handler Methods
    Create context-specific handler methods in Trigger handlers

    4) Bulkify your Code
    Bulkifying Apex code refers to the concept of making sure the code properly handles more than one record at a time.

    5) Avoid SOQL Queries or DML statements inside FOR Loops
    An individual Apex request gets a maximum of 100 SOQL queries before exceeding that governor limit. So if this trigger is invoked by a batch of more than 100 Account records, the governor limit will throw a runtime exception

    6) Using Collections, Streamlining Queries, and Efficient For Loops
    It is important to use Apex Collections to efficiently query data and store the data in memory. A combination of using collections and streamlining SOQL queries can substantially help writing efficient Apex code and avoid governor limits

    7) Querying Large Data Sets
    The total number of records that can be returned by SOQL queries in a request is 50,000. If returning a large set of queries causes you to exceed your heap limit, then a SOQL query for loop must be used instead. It can process multiple batches of records through the use of internal calls to query and queryMore

    8) Use @future Appropriately
    It is critical to write your Apex code to efficiently handle bulk or many records at a time. This is also true for asynchronous Apex methods (those annotated with the @future keyword). The differences between synchronous and asynchronous Apex can be found

    9) Avoid Hardcoding IDs
    When deploying Apex code between sandbox and production environments, or installing Force.com AppExchange packages, it is essential to avoid hardcoding IDs in the Apex code. By doing so, if the record IDs change between environments, the logic can dynamically identify the proper data to operate against and not fail.

    Hope this helps.

  • Hi,

    Could you please provide more detail for your requirement.

    Thanks.

  • shariq

    Member
    September 17, 2018 at 11:24 PM in reply to: Why SOAP services are not cacheable in Salesforce?

    Hi,

    To add more -

    REST does not prescribe any particular mechanism for how to encode request parameters in the URL. What is recommended is that clients never do any URL synthesis: let the server do all the URL creation (by whatever mechanism you want, such as embedding within the path or as query parameters). What you definitely shouldn't do is have a GET where the client sends a body to the server! Any cache is likely to lose that. Instead, when that request doesn't correspond to a simple fetch of some resource, you POST or PUT that complex document to the server and GET the result of the operation as a separate stage.

    Hope it helps.

  • shariq

    Member
    September 17, 2018 at 11:22 PM in reply to: What are full copy and partial copy in salesforce?

    Hi,

    1) Full Sandbox - Fully testing changes against real data before promoting to production.  This may include user acceptance testing.  All changes must go through this sandbox.  If multiple admins/developers are working on overlapping areas, this is the place where changes get merged.  Force.com IDE can be used to compare changes by separate developers of the same apex code.

    2) Partial Data Sandbox - This is a new sandbox type and I am not quite sure what the intention was.  Probably just a cheaper alternative to a full sandbox.  If you have a full sandbox, then partial data sandbox sounds like a good place for user training for new features, new employees, etc.  Having real data can really help with training.  Also, possibly a place to work on integration changes since it can hold quite a bit of real data.

    3) Developer - A place to work through solutions to new requirements.  The main idea is to keep random experimentation out of the full sandbox.  It there are multiple admins/developers, each one should get their own so that they don't trample on each others work (until they deploy to the full sandbox).

    4) Developer Pro - The main difference between this and Developer is the amount of data that can be stored.  It also grabs some product data from production.  If those two things are important, use this one.  Otherwise, it's interchangeble with Developer.

    Hope this helps.

  • shariq

    Member
    September 17, 2018 at 11:20 PM in reply to: How can we add a field in object using Salesforce trigger?

    Hi,

    For creating fields through code you need to use meta data apis and one more thing you can't create roll up field for lookup, it should master detail.

    Hope this helps.

  • shariq

    Member
    September 17, 2018 at 11:18 PM in reply to: Why does validation rule not work when we update workflow field?

    Hi,

    To add into this -

    Salesforce runs user-defined validation rules if multiline items were created, such as quote line items and opportunity line items.

    • Executes all before triggers.
    • Runs most system validation steps again, such as verifying that all required fields have a non-null value, and runs any user-defined validation rules. The only system validation that Salesforce doesn't run a second time (when the request comes from a standard UI edit page) is the enforcement of layout-specific rules.
    • Executes duplicate rules. If the duplicate rule identifies the record as a duplicate and uses the block action, the record is not saved and no further steps, such as after triggers and workflow rules, are taken.
    • Saves the record to the database, but doesn't commit yet.
    • Executes all after triggers.
    • Executes assignment rules.
    • Executes auto-response rules.
    • Executes workflow rules.
    • If there are workflow field updates, updates the record again.
    • If the record was updated with workflow field updates, fires before update triggers and after update triggers one more time (and only one more time), in addition to standard validations. Custom validation rules, duplicate rules, and escalation rules are not run again.
    • Executes processes.

    Hope this helps.

  • shariq

    Member
    September 17, 2018 at 11:13 PM in reply to: What are the types of Email Templates in Salesforce?

    Hi,

    Salesforce provides 4 email template types. Here’s an overview of the different types and some considerations.

    1. Text Email Templates

    2. HTML (Using Letterhead) Email Templates

    3. Custom (without using Letterhead)

    4. Visualforce

    Hope this helps.

  • Hi,

    The solution that was released in Spring ’11 (version 24.0) solves for this in a very elegant way. Salesforce implemented a read-only object that you can use to query whether a user has access to a record. The object is appropriately called UserRecordAccess and provides a comprehensive summary of a user’s given access to a particular record. Because it is an object that is designed to be queried, it is very simple to plugin the user’s id and a record id (or set of record ids) and get a result.

    Hope this helps.

  • shariq

    Member
    September 17, 2018 at 11:11 PM in reply to: Can I find out if the current user has access to a record without querying?

    Hi,

    The solution that was released in Spring ’11 (version 24.0) solves for this in a very elegant way. Salesforce implemented a read-only object that you can use to query whether a user has access to a record. The object is appropriately called UserRecordAccess and provides a comprehensive summary of a user’s given access to a particular record. Because it is an object that is designed to be queried, it is very simple to plugin the user’s id and a record id (or set of record ids) and get a result.

    Hope this helps.

  • shariq

    Member
    September 17, 2018 at 11:08 PM in reply to: How do you unit test a trigger when you don't know the required fields?

    Hi,

    You can take out the fields from schema class and fill those values respective to their display type but if there is a validation setup on some fields then you need to contact to your admin because without knowing the validation you can't unit test the code.

    Hope this helps.

  • Hi,

    Use JavaScript remoting in Visualforce to call methods in Apex controllers from JavaScript. Create pages with complex, dynamic behavior that isn’t possible with the standard Visualforce AJAX components.
    Features implemented using JavaScript remoting require three elements:The remote method invocation you add to the Visualforce page, written in JavaScript.
    The remote method definition in your Apex controller class. This method definition is written in Apex, but there are some important differences from normal action methods.
    The response handler callback function you add to or include in your Visualforce page, written in JavaScript

     

    Hope this helps.

  • Hi,

    To add into above -

    1) Many Developers face recursive trigger , or recursive update trigger. For example in 'after update' trigger, Developer is performing update operation and this lead to recursive call.

    2) You want to write a trigger that creates a new record ; however, that record may then cause another trigger to fire, which in turn causes another to fire, and so on.

    Hope this helps.

  • shariq

    Member
    September 17, 2018 at 11:01 PM in reply to: How sales force is useful in tracking sales?

    Hi,

    Salesforce track sales Performance by:

    Use the performance chart on the Home page in Lightning Experience to track your sales performance or the performance of your sales team against a customizable sales goal.

    The performance chart displays data based on your sales team’s opportunities if you have an associated team. Otherwise, the chart displays opportunities you own. Only opportunities for the current sales quarter that are closed or open with a probability over 70% are displayed.

    Closed—The sum of your closed opportunities.
    Open (>70%)—The sum of your open opportunities with a probability over 70%. The blue line in the chart is the combined total of the closed opportunities and open opportunities with a probability over 70%.
    Goal—Your customizable sales goal for the quarter. This field is specific to the performance chart and has no impact on forecast quotas or any other type of goal. Click  edit button to set the goal.

    Hover over the chart to see the closed and committed opportunity amounts for different dates. If you hover over a date when an opportunity was closed or set to a probability over 70%, a blue dot appears. Click the dot to see a window with more opportunity details.The performance chart isn’t refreshed automatically. Click Refresh button   to make sure you have the most up-to-date view of your sales performance.

    Hope this helps.

  • shariq

    Member
    September 17, 2018 at 10:55 PM in reply to: How many batch jobs can be added to the queue in Salesforce?

    Hi,

    The Apex flex queue enables you to submit up to 100 additional batch jobs for execution. 2. However batch apex can have only 5 concurrent (simultaneous) jobs running in parallel. You can only have five queued or active batch jobs at one time.
    Hope this helps.

  • Hi,

    You need to make the callout from a @future or queueable method.

    Hope this helps.

  • shariq

    Member
    September 17, 2018 at 10:53 PM in reply to: How to handle error records in Batch apex in Salesforce?

    Hi,

    You can handle errors in batch related records as shown below -

    if (accountstoUpd.size() > 0) {
    Database.SaveResult[] lsr = Database.update(accountstoUpd,false);
    Integer recordid = 0;
    for (Database.SaveResult SR : lsr) {
    if (!SR.isSuccess()) {
    this.errormsgs += 'Account Record:' + accountstoUpd[recordid].id + ', ' + SR.getErrors()[0].getMessage() + '<br/>';
    }
    recordid++;
    }
    }
    if (this.errormsgs.length() > 0) {
    ErrorLogs__c errtoSave = new ErrorLogs__c(details__c = this.errormsgs);
    insert errtoSave;
    }

    Hope this helps.

  • Hi,

    Methods with the future annotation have the following limits:

    • No more than 50 method calls per Apex invocation

    Asynchronous calls, such as @future or executeBatch, called in a startTest, stopTest block, do not count against your limits for the number of queued jobs.

    • The maximum number of future method invocations per a 24-hour period is 250,000 or the number of user licenses in your organization multiplied by 200, whichever is greater. This limit is for your entire org and is shared with all asynchronous Apex: Batch Apex, Queueable Apex, scheduled Apex, and future methods. To check how many asynchronous Apex executions are available, make a request to the REST API limits resource. See List Organization Limits in the REST API Developer Guide. The licenses that count toward this limit are full Salesforce user licenses or App Subscription user licenses. Chatter Free, Chatter customer users, Customer Portal User, and partner portal User licenses aren’t included.
      Future method jobs queued before a Salesforce service maintenance downtime remain in the queue. After service downtime ends and when system resources become available, the queued future method jobs are executed. If a future method was running when downtime occurred, the future method execution is rolled back and restarted after the service comes back up.
      For access to higher limits for future methods, and to invoke a future method from another future method, use the Future Methods with Higher Limits pilot.

     

    Hope this helps.

  • shariq

    Member
    September 17, 2018 at 10:14 PM in reply to: Is there any expression to bind in Salesforce controllers?

    Hi,

    I think you want to bind controller to vf page-

    try getter setter variables and make sure to extend the controller in vf page -

    <apex:page controller = "TestController">

    OR

    Dynamic Visualforce Bindings
    Dynamic Visualforce bindings are a way of writing generic Visualforce pages that display information about records without necessarily knowing which fields to show. In other words, fields on the page are determined at run time, rather than compile time. This allows a developer to design a single page that renders differently for various audiences, based on their permissions or preferences. Dynamic bindings are useful for Visualforce pages included in managed packages since they allow for the presentation of data specific to each subscriber with very little coding.

    Dynamic Visualforce binding is supported for standard and custom objects. Dynamic bindings take the following general form:

    reference[expression]

    where reference evaluates to either an sObject, an Apex class, or a global variable
    expression evaluates to a string that is the name of a field, or a related object. If a related object is returned, it can be used to recursively select fields or further related objects.

    Hope this helps.

Page 37 of 57