Forum Replies Created

Page 3 of 5
  • Kumar

    Member
    January 23, 2017 at 10:50 am in reply to: How can we integrate through Ip address using REST API in salesforce?

    Hi Vikas,

    You can use Sites for this purpose, and it does not require any authorisation too.

    Hope this helps.

  • Kumar

    Member
    January 23, 2017 at 9:58 am in reply to: How to display Salesforce fieldset using Lightning Component?

    You can refer to this post. Hope this helps.

  • Kumar

    Member
    January 23, 2017 at 8:07 am in reply to: Soap API using Soap ui in Salesforce

    Hi Vikas,

    This is a known issue. Soon, salesforce will be requiring all connections to be TLS v1.1 or higher.

    To fix this issue, follow this blog.

    Hope this helps.

  • Kumar

    Member
    January 23, 2017 at 7:53 am in reply to: Webhook implementation in Salesforce

    Thanks!

  • Kumar

    Member
    January 23, 2017 at 7:51 am in reply to: What are the rules for Mapping URI S in salesforce

    Hi Vikas,

    URL mapping is used to expose your APEX class as a REST resource.

    These are some considerations when using this annotation:

    • The URL mapping is relative to https://instance.salesforce.com/services/apexrest/.
    • A wildcard character (*) may be used.
    • The URL mapping is case-sensitive. A URL mapping for my_url will only match a REST resource containing my_url and not My_Url.
    • To use this annotation, your Apex class must be defined as global.

    For more info regarding path mapping guidelines and what happens when the request URI is not the same, go to this link.

    Hope this helps.

     

    • This reply was modified 7 years, 11 months ago by  Kumar.
  • Hi Naveen,

    Here is an example with countries and states. First, define your Visulforce Page with the picklists.
    You can see that it uses a custom controller and an event "onchange" on country list to change the content of the states list when you select a country.

    Here is the code:

    <apex:page controller="ctlDepPickLst">
    <apex:form >
    <apex:pageBlock>
    <apex:pageBlockSection columns="2">
    <apex:pageblockSectionItem>
    <apex:outputLabel value="Country"/>
    </apex:pageblockSectionItem>
    <apex:pageblockSectionItem>
    <apex:selectList size="1" value="{!country}">
    <apex:selectOptions value="{!countries}"/>
    <apex:actionSupport event="onchange" reRender="a"/>
    </apex:selectList>
    </apex:pageblockSectionItem>
    <apex:pageblockSectionItem>
    <apex:outputLabel value="State"/>
    </apex:pageblockSectionItem>
    <apex:pageblockSectionItem>
    <apex:selectList size="1" value="{!state}" id="a">
    <apex:selectOptions value="{!states}"/>
    </apex:selectList>
    </apex:pageblockSectionItem>
    </apex:pageBlockSection>
    </apex:pageBlock>
    </apex:form>
    </apex:page>

    Here is the custom controller:

    public class ctlDepPickLst {
    public String country {get;set;}
    public String state {get;set;}

    public List<SelectOption> getCountries()
    {
    List<SelectOption> options = new List<SelectOption>();
    options.add(new SelectOption('None','--- Select ---'));
    options.add(new SelectOption('US','United States'));
    options.add(new SelectOption('IN','India'));
    return options;
    }

    public List<SelectOption> getStates()
    {
    List<SelectOption> options = new List<SelectOption>();
    if(country == 'US')
    {
    options.add(new SelectOption('CO','Colorado'));
    options.add(new SelectOption('NE','Nevada'));
    options.add(new SelectOption('TE','Texas'));
    }
    else if(country == 'IN')
    {
    options.add(new SelectOption('BI','Bihar'));
    options.add(new SelectOption('KE','Kerala'));
    options.add(new SelectOption('MA','Manipur'));
    }
    else
    {
    options.add(new SelectOption('None','--- Select ---'));
    }
    return options;
    }
    }

    Hope this helps.

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

    Member
    January 19, 2017 at 2:21 pm in reply to: Controller calling from JavaScript in Salesforce

    Hi Vikas,

    You will have to use the <apex:actionFunction> tag for this, refer to the developer guide on how to use it.

    Hope this helps.

  • Hi Sushant,

    You will have to implement this by changing the style for each part of your page that you wish to hide and show. Something like:

    <button onclick="myFunction()">Try it</button>

    <div id="myDIV">
    This is my DIV element.
    </div>

    <script>
    function myFunction() {
    var x = document.getElementById('myDIV');
    if (x.style.display === 'none') {
    x.style.display = 'block';
    } else {
    x.style.display = 'none';
    }
    }
    </script>

  • Hi Mohit,

    You may use the HTML5 canvas tag for this. I don't know much of HTML5, but you can refer to this link for more guidance.

    Hope this helps.

  • Hi Sushant,

    You will have to use offset in query. Check offset section in below link:

    https://developer.salesforce.com/page/Paginating_Data_for_Force.com_Applications

    Hope this helps.

  • Kumar

    Member
    January 19, 2017 at 1:59 pm in reply to: Can a future method conflict with a queueable method in Salesforce?

    Hi Sushant,

    You will have to use the FOR UPDATE clause to avoid this scenario.

    In Apex, you use FOR UPDATE to lock sObject records while they’re being updated in order to prevent race conditions and other thread safety problems. While an sObject record is locked, no other client or user is allowed to make updates either through code or the Salesforce user interface. The client locking the records can perform logic on the records and make updates with the guarantee that the locked records won’t be changed by another client during the lock period. The lock gets released when the transaction completes.

    To lock a set of sObject records in Apex, embed the keywords FOR UPDATE after any inline SOQL statement. For example, the following statement, in addition to querying for two accounts, also locks the accounts that are returned:

    Account [] accts = [SELECT Id FROM Account LIMIT 2 FOR UPDATE];
    Note: You can’t use the ORDER BY keywords in any SOQL query that uses locking. For more info, see avoiding deadlocks.

     

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

    Member
    January 18, 2017 at 1:43 pm in reply to: How to change the color of a custom button in salesforce?

    Hi Tanu,

    There is no way to declaratively modify the color of a standard button that is part of Salesforce configuration. You can see this other post on some crafty ways to modify the Salesforce CSS.

  • Hi Pranav,

    The visibility of the Apex classes is controlled by the system permission 'View Setup and Configuration’ on the user's profile. There is currently no option to make that more granular and e.g. exclude APEX code from the 'View Setup and Configuration'.

    The 'Security' on Apex classes defines which users/profiles can run the code. More info on that here.

    Hope this helps.

  • Kumar

    Member
    January 18, 2017 at 1:35 pm in reply to: How to call an Apex class / method from Salesforce Visual Workflow?

    Hi Ashley,

    You can also use the Process.Plugin interface to do the same. But this method is not recommended by Salesforce.

    Refer to this link for details. Hope this helps.

  • Hi Pranav,

    To render the <apex:column> dynamically based on the number of fields queried, you should have a tap on number of fields queried in a list of string. Then use that list of fields to get the values from your list using <apex:repeat>.

    For example:

    String query;
    public exportContactRecords()
    {
    String objectName = 'Contact';
    Map<String, Schema.SObjectType> schemaMap = Schema.getGlobalDescribe();
    Map<String, Schema.SObjectField> fieldMap = schemaMap.get(objectName ).getDescribe().fields.getMap();
    set<string> mapset = fieldMap.keyset();

    Then do something like,

    List<String> lstFields = new List<String>();
    for ( String str:mapset )
    {

    lstFields.add(str);

    }

    Then use this lstFields List in your repeat tag, like this,

    <apex:repeat value="{!lstFields}" var="FieldLable">
    <apex:column value="{!c[FieldLable]}"/>

    Hope this helps.

     

     

    • This reply was modified 7 years, 11 months ago by  Kumar.
  • Hi Tanu,

    You have two options.

    1. Fire an event that your containing component can listen for and act upon.
    2. Pass in a reference to the attribute to the child component.

    <c:childComponent myValue="{!v.B}"/>

    When the childComponent updates myValue, v.B will also update.

    Hope this helps.

  • Kumar

    Member
    January 16, 2017 at 12:52 pm in reply to: How can I add a new Clean Rule in my Salesforce Developer Org?

    Hi Pranav,

    Refer to this link, which explains the requirements and procedure to create new clean rules.

    Hope this helps.

     

  • Kumar

    Member
    January 16, 2017 at 10:33 am in reply to: How can you do the following in Salesforce?

    Hi Regula,

    I don't you can directly do this, but this can be achieved by using a workaround.

    1. Add a check box to the object, but don't show it on the page layout.
    2. Check whether this is true on all your validations , workflows or triggers.
    3. During data import turn this check box off.

    Hope this helps.

  • Kumar

    Member
    January 16, 2017 at 10:29 am in reply to: What are force.com sites?

    Hi Regula,

    Refer to this developer guide to get a basic idea about sites.

  • Hi Pranav,

    If you remember the deletion time, then you can query by 'LastModifiedDate' which holds the deletion day and time of the record.

    So, you could do something along the lines of:

    SELECT Id,Name FROM Account WHERE isDeleted = True AND LastModifiedDate = '<your value>' ALL ROWS

    and then undelete the specific account.

    Hope this helps!

  • Hi Vikas,

    You can use the query editor in the developer console to view any object's records, irrespective of if it has been launched as a tab.

    For example:

    SELECT Id, name, UnitPrice FROM PricebookEntry

    Then use the 'open detail page' button for any specific record to view its detail page.

    Hope this helps.

  • Hi Vikas,

    Test classes need to pass in the dev org when packaging. Not needed when installing

    However, you should design your tests as best you can to pass in customer org. Also if performing call outs, provide a framework that your subscriber can use in their tests to mock responses when your package makes a call out during their tests.

    So while they do not have to pass in subscriber org technically, it is still considered a good practice to design your test classes to run in the customer org.

  • Kumar

    Member
    January 16, 2017 at 10:04 am in reply to: Callback Function in Java Script Remoting in salesforce

    Hi Vikas,

    Remote Objects sends all requests to the Salesforce service asynchronously. Your code handles responses to Remote Objects operations in a callback function that you provide. Callback functions handle updating the page with the results of the operation and errors that are returned.

    When you invoke a Remote Objects operation, you provide the parameters of the operation and, optionally, a callback function. Your JavaScript code continues uninterrupted after you invoke the operation. When the remote operation is completed and results are returned, your callback function is invoked and receives the results of the operation.

    For an example and more information refer to the developer guide.

     

  • Kumar

    Member
    January 16, 2017 at 7:25 am in reply to: What are the uses of Lightning Schema in Salesforce?

    Hi Sushant,

    Schema Builder provides a dynamic environment to add new custom objects, custom fields, and relationships to your schema. This eliminates the need to click from page to page to find the details of a master-detail relationship or to add a new custom field to an object in your schema. For example, if you’re using Schema Builder to view the details of your schema, you can add a new custom object without leaving Schema Builder. The drag-and-drop interface lets you easily add a custom object or new field, and saves the layout of your schema any time you move an object.

    Schema Builder provides details such as the field values, required fields, and how objects are related by displaying lookup and master-detail relationships. You can view the details for both standard and custom objects in Schema Builder.

    For more info on how to use Schema Builder, refer to this trailhead module.

  • Kumar

    Member
    January 16, 2017 at 7:22 am in reply to: Error in Salesforce Ligthning component

    Hi Vikas,

    Your controller code seems to be fine, please check your page. Maybe there is some minor formatting error associated with the button you made on the page.

     

Page 3 of 5