Forum Replies Created

Page 4 of 5
  • Kumar

    Member
    January 16, 2017 at 7:11 am in reply to: Getting the current visualforce page name in Salesforce

    Thanks

  • Hi Sushant,

    For re-rendering a list in lightning, you just need to use component.set to set the value of the list attributes with updated values (which you obtain from a client side APEX controller maybe?).

    Example:

    This is your attribute:

    <aura:attribute name="expenses" type="Expense__c[]"/>

    So in your JS controller, you do something like:

    var expenses = component.get("v.expenses");
    expenses.push(response.getReturnValue());
    component.set("v.expenses", expenses);

    where the response is coming from the client-side controller.

    Hope this helps.

  • Hi Sushant,

    Yes, it can. To this you have to roughly follow these steps:

    1. Create the component using $A.createComponent
    2. Finding the parent component to attach the dynamic child using component.find(parentId) which returns the  component instance(Aura.Component)
    3. Then getting the body of the above, then adding dynamic child to the body and setting the body.
    4. So, child component(dynamic) needs to be inside the body of the parent component to be rendered in the view.

    Also remember, you are attaching the dynamically created component to the body of the <div aura:id="divDynamicChild"></div> not to the actualy body of the component <c:testFindDynamic_Parent>.

    Hope this helps.

     

  • Kumar

    Member
    January 12, 2017 at 2:43 pm in reply to: How to use Enqueue action in salesforce Lightning page?

    Hi Sushant,

    Enqueue action is used in lightning javascript controllers to call server-side action.

    Refer to this developer guide to understand the working.

  • Kumar

    Member
    January 12, 2017 at 2:38 pm in reply to: Custom Tab not showing in Salesforce Lightning navigation menu

    Thanks dude!

  • Hi Srikanth,

    Refer to the following blogs to help understand the difference:

    Blog 1

    Blog 2

    Hope this helps.

    • This reply was modified 7 years, 10 months ago by  Kumar.
  • Kumar

    Member
    January 11, 2017 at 1:28 pm in reply to: Future Method And Batch Class in Salesforce

    Hi Vikas,

    Yes, it will work but it not considered the best practice as you are calling an asynchronous code block inside an already asynchronous Execute method of the batch.

    You can very well only use the batch class for most use cases and still provide functionality.

    Hope this helps!

  • Hi Mohit,

    Time dependent workflows verify the criteria first and then, if the criteria is met, then only the time dependent action is performed.

    For example, if you have defined the action to be performed after a week, then

    • the workflow will fire
    • evaluate criteria
    • then if criteria is met, the action will be performed after one week.

    Hope this helps.

  • Kumar

    Member
    January 11, 2017 at 9:47 am in reply to: What is Remote Action in Salesforce/What is the use of this action?

    Hi Sushant,

    JavaScript remoting in Visualforce provides support for some methods in Apex controllers to be called via JavaScript.

    JavaScript remoting has three parts:
    1. The remote method invocation you add to the Visualforce page, written in JavaScript.
    2. The remote method definition in your Apex controller class. This method definition is written in Apex, but there are   few differences from normal action methods.
    3.The response handler callback function you add to or include in your Visualforce page, written in JavaScript.

    For more info on why we use Javascript remoting, refer to this blog.

    Hope this helps.

  • Kumar

    Member
    January 11, 2017 at 7:22 am in reply to: Difference between session cache and org cache in salesforce

    Hi Vikas,

    The difference between them is as follows:

    Org Cache
    Org cache stores org-wide data that anyone in the org can use. Org cache is accessible across sessions, requests, and org users and profiles.

    For example, weather data can be cached and displayed for contacts based on their location. Or daily snapshots of currency exchange rates can be cached for use in an app.

    Session Cache
    Session cache stores data for an individual user and is tied to that user’s session. The maximum life of a session is 8 hours.

    For example, suppose that your app calculates the distance from a user’s location to all customers the user wishes to visit on the same day. The location and the calculated distances can be stored in the session cache. That way, if the user wants to get this information again, the distances don’t need to be recalculated. Or, you might have an app that enables users to customize their navigation tab order and reuse that order as they visit other pages in the app.

    Hope this helps.

  • Hi Pranav,

    You can refer to this blog.

    Hope this helps.

  • Kumar

    Member
    January 10, 2017 at 12:04 pm in reply to: How to post data using Bulk API using workbench tool in Salesforce?

    Hi Sushant,

    Your request body format seems to be correct, just cross check the session id value. You may have copied an extra space in the id, happens all the time.

    Also the session id expires after specific time period, unless you keep making requests before that periodically.

    • This reply was modified 7 years, 10 months ago by  Kumar.
  • Kumar

    Member
    January 10, 2017 at 11:01 am in reply to: Issue with After Trigger And Before Trigger in Salesforce

    Hi Vikas,

    The reason your code is not working the same in the 'before' trigger is because the new opportunity you have inserted has still not been committed in the database, hence it does not have a Id value for now which you are querying here:

    for(Opportunity A:[SELECT id FROM Opportunity WHERE StageName = ‘Closed Won’ AND id IN :Trigger.New])

    Hope this helps.

     

  • Kumar

    Member
    January 10, 2017 at 10:54 am in reply to: Queueable Method and future method in Salesforce

    Hi Vikas,

    If you were exceeding a governor limit in your future method, or if you think a future method requires a higher limit, you can possibly increase the limits for your future method,see Future Methods with Higher Limits.

    Another reason to use future methods instead of queueable is when your functionality is sometimes executed synchronously, and sometimes asynchronously. It’s much easier to refactor a method in this manner than converting to a queueable class. This is handy when you discover that part of your existing code needs to be moved to async execution. You can simply create a similar future method that wraps your synchronous method like so:

    @future
    static void myFutureMethod(List<String> params) {
    // call synchronous method
    mySyncMethod(params);
    }

    Hope this helps.

  • Kumar

    Member
    January 10, 2017 at 10:48 am in reply to: CallBack Url Relation with Api

    Hi Vikas,

    A callback URL will be invoked by the API method you're calling after it's done. So if you call

    POST /api.example.com/foo?callbackURL=http://my.server.com/bar

    Then when /foo is finished, it sends a request to http://my.server.com/bar. The contents and method of that request are going to vary - check the documentation for the API you're accessing.

     

  • Kumar

    Member
    January 9, 2017 at 6:27 am in reply to: Error while making callout in salesforce

    Hi,

    It means that the website you are calling with HTTPS has a domain name that is different from what you're using.  So if you think you're calling "https://api.myservice.com", and the website's certificate is only for "www.myservice.com", you get this error.  If you connect to the service using a browser, see if it has a security exception, and if not, if the domain name redirected, then check the domain name of the service you're calling to make sure it's the right one (see https://en.wikipedia.org/wiki/Subject_Alternative_Name).

    Unfortunatelly this error also occurs when multiple certificates are hosted on the same IP address. It seems that salesforce is missing SNI support (see http://en.wikipedia.org/wiki/Server_Name_Indication).

    Hope this helps.

     

    • This reply was modified 7 years, 10 months ago by  Kumar.
    • This reply was modified 7 years, 10 months ago by  Kumar.
  • Hey Sushant,

    JSON Parsing in Salesforce can be done by two ways:

    1. By deserializing the JSON into a class.
    2. Using JSON.Parser methods.

    You can refer to https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_json_jsonparser.htm

    Hope this helps!

  • Kumar

    Member
    January 9, 2017 at 5:33 am in reply to: How to update a field after every 24hrs in salesforce?

    Hi Pranav,

    You can use schedulable apex to auto-update a field every 24hrs.

    Following is the snippet of anonymous code which will help you to schedule your apex Job to run Every HOUR.

    ScheduleclassEveryhour objschclass = new ScheduleclassEveryhour ();
    string strSeconds = '0';
    string strMinutes = '0';
    string strHours = '0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23';
    string strDay_of_month = '*';
    string strMonth = '*';
    string strDay_of_week = '?';
    String sch = strSeconds + ' ' + strMinutes + ' ' + strHours + ' ' + strDay_of_month + ' ' + strMonth + ' ' + strDay_of_week;
    system.schedule('ScheduleclassEveryhour', sch, objschclass);

    You can implement the field updation logic inside this 'ScheduleclassEveryhour' class which implements the Schedulable interface.

    Hope this helps!

     

     

     

    • This reply was modified 7 years, 10 months ago by  Kumar.
  • Hi Upendra,

    Go into the custom object's definition and scroll down to the Search layouts section, and look at the <SObject> List View for your custom object.  The 4th column from the left ('Buttons Displayed') shows you which buttons are currently displayed when you are on the list view.

    Clicking Edit next to the List View will bring you to the selection screen where you can add/remove the Standard Buttons as well as any custom buttons that you may have created.

    I hope this helps you out!

     

  • Kumar

    Member
    January 6, 2017 at 1:38 pm in reply to: How can we make Rest API callout inside Trigger in salesforce

    Hi Vikas,

    To make a REST API callout inside a trigger, you need to create a future method and then use that method in your trigger.

    You can not use regular methods for API callouts in a trigger.

  • Hi vikas,

    There is no soql command to delete rows directly. What you can do instead is to create a list with all the accounts in your org and then delete that list.

    For example:

    list<Account> acc = [SELECT id FROM Account];                                                                                                 delete acc;

    Hope this helps.

  • Kumar

    Member
    January 6, 2017 at 11:55 am in reply to: Difference between Json parsing and Json deserialization in salesforce?

    Hi Sushant,

    JSON deserialization is a method used for JSON parsing in salesforce.

    We can deserialize a JSON response into a class using the 'JSON.deserialize' method.

    For more info you can go to:

    https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_json_jsonparser.htm

    Hope this helps

     

  • Hey Vikas,

    The order of execution in Salesforce is as follows:

    1. System Validation rule (required field, field format)
    2. Before Triggers are executed
    3. Custom Validation rules are checked
    4. After Triggers are executed
    5. Assignment Rules are executed
    6. Auto-Response Rules are executed
    7. Workflow Rules are executed
    8. Before and after triggers are executed one more time if the workflow rule updates a field
    9. Escalation Rules are executed
    10. Parent Rollup Summary Formula or Cross Object Formula fields are updated in the respective objects. (These parent records also goes through the entire execution order)
    11. Criteria Based Sharing rules are evaluated
    12. Any Post-Commit Logic is executed (like sending an email)

    Hope this helps.

  • Hi Sushant,

    External objects are supported in API version 32.0 and later. External objects are similar to custom objects, but external object record data is stored outside your Salesforce organization. For example, perhaps you have data that’s stored on premises in an enterprise resource planning (ERP) system. Instead of copying the data into your org, you can use external objects to access the data in real time via web service callouts.
    External objects are available with Salesforce Connect and Files Connect. Each external object is associated with an external data source definition in your Salesforce organization.

    For more info, refer to:

    https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_external_objects.htm

     

Page 4 of 5