Forum Replies Created

Page 3 of 7
  • Hi Suraj

    Access tokens have a limited lifetime specified by the session timeout in Salesforce. If an application uses an expired access token, a “Session expired or invalid” error is returned. If the application is using the Web server or user-agent OAuth authentication flows, a refresh token may be provided during authorization that can be used to get a new access token.

    For more info:https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/intro_understanding_refresh_token_oauth.htm

    Hope it may help you:

  • Saurabh

    Member
    April 27, 2017 at 2:46 pm in reply to: What are the Force.com editions and salesfoce.com editions?

    Hi Manpreet

    For salesforce.com editions you can refer to this:https://help.salesforce.com/articleView?id=overview_edition.htm&type=0

    For force.com editions you can refer to this:https://www.salesforce.com/editions-pricing/app-cloud/

    Hope it may helps

     

  • Hi Suraj

    Perform a string replace on the json string, the implications of this is unintended replacement of valid text inside a string, but this could be mitigated if the form of the json is as you've supplied "currency": "ABC" you could string replace:

    jsonString.replace('"currency":', '"currency_x":');

    Hope it may help you:

  • Saurabh

    Member
    April 27, 2017 at 2:25 pm in reply to: In which edition work flows are available in Salesforce?

    Hi manpreet

    In Enterprise edition and in unlimited edition, we have these work flows. We do not have these work flows in group and professional editions. We can get these workflows in professional edition also as an add-on.

    Hope it may help you:

  • Hi Manpreet

    Hi Manpreet

    there are three types of bindings used in Visualforce

    1. Data binding
    2. Action bindings
    3. Component bindings

    Data bindings refer to the data set in the controller.
    Action bindings refer to action methods in the controller.
    Component bindings refer to other Visualforce components

    Hope it may help

  • Hi Manpreet

    the three types of bindings used in Visualforce

    1. Data binding
    2. Action bindings
    3. Component bindings

    Data bindings refer to the data set in the controller.
    Action bindings refer to action methods in the controller.
    Component bindings refer to other Visualforce components

    Hope it may help

  • Saurabh

    Member
    April 26, 2017 at 2:08 pm in reply to: Is there any Payment Gateway which I can use/test free?

    Hi Suraj

    Yes there is Paypal payment gateway which is free and you can use .

    You can use paypal payment gateway which provide you functionality of using payment gateway in test mode

    In paypal payment gateway you can make your sandbox account in which you can perform all payment gateway functionalities

    For more information :https://developer.paypal.com/developer/applications/

  • Saurabh

    Member
    April 26, 2017 at 1:59 pm in reply to: How can you embed a Visualflow in a Salesforce Visualforce page?

    Hi Manpreet

    To customize a flow’s look and feel or enhance its functionality, embed it in a Visualforce page. If your org has flows enabled for sites and portals, use the Visualforce page to deliver the flow to your Force.com site, portal, or community.

    you can look  in to this for better understanding: https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_flows_adding.htm

    Hope it may help you

  • Saurabh

    Member
    April 26, 2017 at 1:05 pm in reply to: What is Blob in Salesforce? Where it is Used?

    Hi Suraj

    Blob is a collection of binary data stored as a single object. You can convert this data type to String or from String using the toString and valueOf methods, respectively. Blobs can be accepted as Web service arguments, stored in a document (the body of a document is a Blob), or sent as attachments.

    Blob Methods
    The following are methods for Blob.
    size()
    Returns the number of characters in the Blob.
    toPdf(stringToConvert)
    Creates a binary object out of the given string, encoding it as a PDF file.
    toString()
    Casts the Blob into a String.
    valueOf(stringToBlob)
    Casts the specified String to a Blob.

    Hope it may help:

     

  • Hi Suraj

    You can use Deserialization Technique when you want to get more values from json
    but if you want to get only single Value the go for Json parser

    Hope it helps

  • Saurabh

    Member
    April 26, 2017 at 6:18 am in reply to: How to implement Custom Setting in apex?

    Hi Suraj

    Custom settings are similar to custom objects and enable application developers to create custom sets of data, as well as create and associate custom data for an organization, profile, or specific user. All custom settings data is exposed in the application cache, which enables efficient access without the cost of repeated queries to the database. This data can then be used by formula fields, validation rules, flows, Apex, and the SOAP API.

    You can use SOQL to query Custom Settings just like an object. Use a SQOL query to find the right value:

    select yourfieldname from customsettingname
    where fieldname = :someval and fieldname = :otherval

    Suppose you have custom setting Games__c.

    You can get the list of records through :
    List<Games__c> mcs = Games__c.getall().values();

    To get individual record 'My Games' of custom setting :
    Games__c objGame = Games__c.getValues('My Games');

    Hope it helps:

  • Saurabh

    Member
    April 25, 2017 at 2:41 pm in reply to: What are Cursors in Salesforce?

    Hi Manpreet

    a cursor is a reference to the the result set for a soql query.

    Select Id, name, (select Id, name from contacts) from account

    Will account for 2 open cursors.

    The way out was to simplify the soql queries and break what we were trying to achieve in one batch apex class over 2 classes.

    Hope it may help

  • Hi Manpreet
    Are referenced by another object through a lookup field or that are on the master side of a master-detail relationship
    Are referenced in a reporting snapshot
    Have a custom index or an external ID

    Also See this article:https://help.salesforce.com/articleView?id=dev_object_trunc_overview.htm&language=en_US&type=0

    Hope it may helps

     

  • Saurabh

    Member
    April 25, 2017 at 2:01 pm in reply to: MIXED_DML_OPERATION error in Salesforce?

    Hi Suraj

    You can easily run into this error if you are trying to perform DML on setup and non-setup objects in the same transaction.

    Non-Setup objects are standard objects like Account or any custom object.

    Setup objects are Group1, GroupMember, QueueSObject, User2, UserRole, UserTerritory, Territory, etc..

    For example, you cannot insert an account and then insert a user or a group member in a single transaction.

    Test methods allow for performing mixed DML operations between the sObjects listed earlier and other sObjects if the code that performs the DML operations is enclosed within System.runAs method blocks. This enables you, for example, to create a user with a role and other sObjects in the same test.

    Hoping it may help you:

  • Hi Suraj

    You can use this code given below:

    global class classname implements Database.Batchable<sObject>{
    global Database.QueryLocator start(Database.BatchableContext batchcontext){
    String query = 'select id,name from Account';
    return Database.getQueryLocator(query);
    }
    global void execute(Database.BatchableContext batchcontext,list<Account> scope){
    for(Account a:scope){
    a.name = a.name.removeEnd('stringname');// If you appended string at last

    a.name = a.name.removeStart('stringname');//If you appended String at start
    update scope;
    System.debug(scope);

    }
    global void finish(Database.BatchableContext batchcontext){}
    }

    Hope it may help

  • Saurabh

    Member
    April 25, 2017 at 1:16 pm in reply to: Sequence of Execution of Triggers on "before insert"

    Hi Suraj

    If you write two triggers, there is no particular order of execution and one might run first and sometimes second. In order to control the triggers order of execution, many experts have built Trigger Templates,that basically allow developers to control the order of execution and also control when the trigger needs to be fired. Please take a look at the below blog, you can even search for "Trigger Template" and get many other posts

    http://www.tgerm.com/2012/01/salesforce-apex-trigger-template.html

    Hope it may help

  • Saurabh

    Member
    April 24, 2017 at 1:37 pm in reply to: How can we implement pagination in Visualforce?

    Hi Manpreet

    In spring 12, Salesforce has come up with ability of SOQL to get records from position “X” instead of position “1” every time to help creating pagination feature.

    Pagination-in-SOQL-using-keyword-Offset

    Select Id, Name from Lead LIMIT 5 OFFSET 2

    Above query will return 5 Lead records starting from record number 10 (5×2).

    You can get more information by going through this link:https://developer.salesforce.com/blogs/developer-relations/2012/01/soql-offset-in-spring-12.html

    Hope it helps

  • Saurabh

    Member
    April 24, 2017 at 1:26 pm in reply to: What are different APIs in salesforce.com?

    Hi Suraj

    Different APIs in salesforce.com are:

    REST API - Access objects in your organization using REST.
    SOAP API - Integrate your organization’s data with other applications using SOAP.
    Tooling API - Build custom development tools for Force.com applications. Coming soon!
    Chatter REST API - Access Chatter feeds and social data such as users, groups, followers, and files using REST.
    Bulk API - Load or delete large numbers of records.
    Metadata API - Manage customizations in your org and build tools that manage the metadata model (not the data, itself).
    Streaming API - Provide a stream of data reflecting data changes in your organization.
    Apex REST API - Build your own REST API in Apex. This API exposes Apex classes as RESTful Web services.
    Apex SOAP API - Create custom SOAP Web services in Apex. This API exposes Apex classes as SOAP Web services.
    Data.com API - Data.com provides 100% complete, high quality data, updated in real-time in the cloud, and with comprehensive coverage worldwide.

    Hope it may helps

  • Saurabh

    Member
    April 24, 2017 at 6:59 am in reply to: Create a custom perspective using panels?

    Hi Manpreet

    A perspective is a predefined layout of panels in the Developer Console Log Inspector.
    When you perform a task in the Log Inspector, use a perspective that makes completing the task fast and easy. Every developer has a different style. For a list of out-of-the box perspectives, see Log Inspector.

    To create a custom perspective or modify an existing perspective:

    1. In the Developer Console, open a log in the Log Inspector.
    2. Click Debug | View Log Panels and select the panels you want to include in the perspective.

    For a list of available panels, see Log Panels. If you modify a perspective, an * is appended to the perspective name until it is saved.

    #If you create a perspective that includes the Execution Log panel, you may want to include the Source panel.#

    To save your changes, click Save Perspective. To create a new perspective, click Save Perspective As and enter a new name.

    You can get more information about it by going through this link:https://help.salesforce.com/articleView?id=code_dev_console_perspectives_creating.htm&language=th&type=0

    Hope it may help you:

  • Hi Manpreet

    use <apex: page contentType="application/msWord">

    If need any help regarding apex and Visualforce page kindly use developer board

    http://use If need any help regrading apex and visualforce page kindly use developer board

    Hope it will help you:

  • Hi Manpreet

    First thing to remember is that "Worflow rule" is not a field type in salesforce. Workflow rule is the process automation tool that automate your business flow .
    Formula field: it is a field type on salesforce that produce a read only ouptut. Sometimes u want some calculated value in a field lest say i want my total sell in day in one field then i can create one formula field on my object and i will write a formula that will calculate total sell .
    The field included in formula field is called it's source.

    Now there is a similarity between workflow and formula field.:
    Whenever there is a change in the source field of formula field it automatically re-calculate its field value according to updated value in the source field.
    In same fashion workflow can also do the field update.

    one more thing formula field can't use the workflow but inside a workflow we use formula field.
    there are only one criteria to update the value of formula field but for workflow u can define different kind of criteria.

    Hope it will help you.

  • Saurabh

    Member
    April 24, 2017 at 6:32 am in reply to: can we define custom time out for each callout in salesforce?

    Hi Suraj

    The default timeout is 10 seconds. A custom timeout can be defined for each callout. The minimum is 1 millisecond and the maximum is 120,000 milliseconds.

    For more information you can refer to this link:https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_callouts_timeouts.htm

    Hope it may helps:

  • Saurabh

    Member
    April 24, 2017 at 6:23 am in reply to: How to return Map result from SOQL query in Apex?

    Hi Suraj

    You can perform this operation by going through this code given below:

    //Creating List of all account Ids
    List<id> accIdsList = new List<id>() ;

    //Creating set of all account Ids
    Set<id> accIdsSet = new Set<id>() ;

    //Fetching all accounts
    List<account> accList = new List<Account>();

    //Creating Map with account id as key and account record as value
    Map<Id,Account> accountIdObjMap = new Map<Id,Account>([select Id,name,site,rating,AccountNumber from account limit 50000]);

    //getting list of account using map.values method
    accList = accountIdObjMap.values();

    //getting set of account Id's using map.keySet method
    accIdsSet = accountIdObjMap.keySet();

    //getting list of account Id's using list.addAll method
    accIdsList.addAll(accIdsSet);

    To clarify, this method can only be used to generate Maps using Id of the object you are querying as the key. If you want to use a different value as the key, you will have to iterate over the list returned by your query and put values into a Map. For instance, if you wanted to use AccountId as the key, you would need to do something like this: List<Opportunity> oppList = [Select Id, AccountId from Opportunity]; Map<Id,Opportunity> accOppMap = new Map<Id,Opportunity>(); for(Opportunity o : oppList){ accOppMap.put(o.AccountId,o); }

    Hope this may help

  • Saurabh

    Member
    April 21, 2017 at 2:34 pm in reply to: How to fetch data from another Salesforce instance using API?

    Hi Suraj

    you can use the FORCE.COM WEB SERVICES API or BULK API to transfer data We this ,this is a great job for the Bulk API

    Hope it may help

  • Saurabh

    Member
    April 21, 2017 at 2:29 pm in reply to: How will one workflow effects another workflow in Salesforce?

    Hi Suraj
    Yes If one workflow field update one field and there is another workflow which gets trigger (provided that on field update "Re-evaluate Workflow Rules after Field Change" is checked).
    Check here for more details :https://help.salesforce.com/apex/HTViewHelpDoc?id=workflow_field_updates_reevalute_wf.htm

    Hoping it may help you:

Page 3 of 7