Forum Replies Created

Page 42 of 53
  • Parul

    Member
    September 15, 2018 at 3:37 pm in reply to: What is RestResource Annotation in Salesforce?

    Hi

    The @RestResource annotation is used at the class level and enables you to expose an 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.

     

    Thanks

  • <apex:page>
    <script>
    function callActionFUnction(){
    call();
    }
    function saveHandler(){
    }
    </script>
    <apex:actionfunction action="{!saveFields }" oncomplete="saveHandler()" name="call" reRender="success"/>
    <apex:commandButton status="busy" value="Save" onclick="callActionFUnction()"/>
    </apex:page>

     

    Thanks

  • Parul

    Member
    September 15, 2018 at 3:14 pm in reply to: What are salesforce instances?

    Salesforce instance refers to the server that your Salesforce organization lives on. ManySalesforce orgs (also referred to as an “instance”) live together on the same server, a method of server management called “multi-tenancy”. As opposed to one system living on one server, many instances live on one server.

     

    Thanks

  • You can take list of Account by using @RemoteAction:

    Apex Class

    public class AccountRemoteActionController {
    public String accountName { get; set; }
    public static List<Account> accounts { get; set; }

    public AccountRemoteActionController(){}

    @RemoteAction
    global static List<Account> getAccount(String accountName){
    String updatedAccName = '%'+accountName+'%';
    accounts = [select id, name, phone, type, numberofemployees from Account where name LIKE :updatedAccName];
    System.debug('Account Size : '+accounts.size());
    return accounts;
    }
    }

    VF Page

    <apex:page controller="AccountRemoteActionController">
    <script>
    function getAccountJS(){
    var accountNameJS = document.getElementById('accName').value;
    AccountRemoteActionController.getAccount(accountNameJS,
    function(result, event){
    if(event.status){
    for(var i=0; i < result.length; i++){
    document.getElementById("{!$Component.theBlock.thePageBlockSection.theFirstItem.accId}").innerHTML = result[i].Id;
    document.getElementById("{!$Component.theBlock.thePageBlockSection.theSecondItem.accNam}").innerHTML = result[i].Name;
    document.getElementById("{!$Component.theBlock.thePageBlockSection.theThirdItem.accPhone}").innerHTML = result[i].Phone;
    }
    }else if(event.type === 'exception'){
    document.getElementById("errors-js").innerHTML = event.message;
    }else{
    document.getElementById("errors-js").innerHTML = 'No Records Found..';
    }
    },{escape : true});
    }
    </script>
    Account Name : <input id="accName" type="text" />
    <button onclick="getAccountJS()">Get Account</button>
    <div id="errors-js"></div>

    <apex:pageBlock id="theBLock">
    <apex:pageBlockSection id="thePageBlockSection" columns="4">
    <apex:pageBlockSectionItem id="theFirstItem">
    <apex:outputText id="accId"/>
    </apex:pageBlockSectionItem>
    <apex:pageBlockSectionItem id="theSecondItem" >
    <apex:outputText id="accNam" />
    </apex:pageBlockSectionItem>
    <apex:pageBlockSectionItem id="theThirdItem" >
    <apex:outputText id="accPhone" />
    </apex:pageBlockSectionItem>
    </apex:pageBlockSection>
    </apex:pageBlock>
    </apex:page>

     

    Hope this will help you .

     

    Thanks

  • You can use recordSetVar and apex:repeat to view the list and variable “var” in <apex:repeat> tag to acess the records.

     

    <apex:repeat value="{!accs}" var="acc">
    <tr>
    <td><apex:outputText value="{!acc.Name}"/></td>
    <apex:repeat value="{!acc.Contacts}" var="cont">
    <td><apex:outputText value="{!cont.Name}"/></td>
    </apex:repeat>
    </tr>
    </apex:repeat>

     

    Thanks

  • Its not possible that two objects can have same id in different org.

     

    Thanks

  • Yes in Handler we can perform actions on more than one javascript functions because all  controller method is shared across handler.

     

     

    Thanks

  • Parul

    Member
    September 15, 2018 at 2:45 pm in reply to: What are setup objects in Salesforce?

    The setup objects in Salesforce are objects that work for metadata like User and Profile and on setup object we can not perform DML operation.

     

     

    Thanks

  • In single transaction it's not possible to insert account and its related contacts because you have to insert first parent then its child record.

     

     

    Thanks

  • Apex code1-

    Creates a PageReference to any page that is hosted on the Lightning platform. For example, setting ‘partialURL’ to ‘/apex/Hello’ refers to the Visualforce page located at mySalesforceInstance/apex/Hello. Likewise, setting ‘partialURL’ to ‘/’ + ‘recordID’ refers to the detail page for the specified record.

    Apex code2-

    By referring to a page in this way, the platform recognizes that this controller or controller extension is dependent on the existence of the specified page and will prevent the page from being deleted while the controller or extension exists.

     

    Thanks

  • Parul

    Member
    September 15, 2018 at 2:36 pm in reply to: Can we remove custom validation rule through Salesforce apex code?

    I think you cannot remove custom validation rule through apex code but  there is only one solution is make a checkbox type field and then bypass the validation by using apex code.

     

     

    Thanks

  • Parul

    Member
    September 15, 2018 at 2:27 pm in reply to: What is Text(Encrypted) Data type in Salesforce sobject?

    Encrypt field data like credit card number, social security number not to visible. It allows users to store sensitive data in encrypted form and apply a mask when the data is displayed.

     

    Thanks

  • Parul

    Member
    September 15, 2018 at 2:24 pm in reply to: What is runAs() method in salesforce?

    You can use runAs only in test methods. The original system context is started again after all runAs test methods complete.

    The runAs method ignores user license limits. You can create new users with runAs even if your organization has no additional user licenses.

    @isTest
    private class CampaignTriggersTest{
    private static testmethod void campaignTriggersTest(){
    Profile prof = [select id from profile where name LIKE ‘%marketing%’];
    User user = new User();
    user.firstName = ‘test1’;
    user.lastName = test2;
    user.profileId = prof.id,username = ‘[email protected]’;
    user.email = ‘[email protected]’;
    insert user;
    system.runAs(user){
    Campaign campaign = new Campaign();
    campaign.name = ‘laptop’;
    insert campaign();
    }
    }
    }

     

    Thanks

  • A Rollup Summary field is used to calculate the sum of a fields in the child object record. It is compulsory to be in a Master-Detail relationship to use the rollup summary. Where as formula field is mostly used for calculations with in acertain object. And it is child to Parent.

     

    Thanks

  • Yes it's possible but for that you need to clone it and in the next version of that you can edit the action and criteria of process builder.

     

     

    Thanks

  • Changesets are a way to deploy components through the standard salesforce UI. A user first creates a Outbound Changeset on the Source org and adds the components they wish to deploy. Once ready, the changes is uploaded to a Destination ORG. The deployment can then be validated and deployed from within the Destination ORG>

    -Packages: In the packages you can deploy the metatdata across the orgnizations.
    You don't need access/ deployment connections with the other org. So when you need to deploy the metadata to many orgs, in that case we use packages.

      -Managed Packages: The components will be locked i.e. you cannot change. Aslo upgrades to the components will be availablle.

     

    Thanks

     

  • Parul

    Member
    September 15, 2018 at 8:03 am in reply to: What are changeset, eclipse & ant in Salesforce?

    Changesets are a way to deploy components through the standard salesforce UI. A user first creates a Outbound Changeset on the Source org and adds the components they wish to deploy. Once ready, the changes is uploaded to a Destination ORG. The deployment can then be validated and deployed from within the Destination ORG>

    Ant and Eclipse both use security tokens, but only outside the trusted network. This is usually a non-issue for people that work in offices, because they have static IP ranges they can list to nullify this requirement.

    Eclipse can't push code without coverage to production environments. You can never, ever break this cardinal rule, no matter how you deploy. Sandboxes and developer editions do not require testing or coverage, however.

    Eclipse IDE:
    Mainly used to deploy between one org to another org.
    It provides a comfortable environment for programmers familiar with integrated development environments, allowing you to the code, compile, test, and package and deploy all from within the IDE itself
    Metadata files are the text-based, they also can be compared using text diff tools, managed in a version control system such as CVS or Subversion, and even deployed from one Salesforce organization to another
    Project Synchronization working Online or Offline project.
    A version control system allows you to track changes to a set of files over the time.

     

    Thanks

  • Parul

    Member
    September 15, 2018 at 7:59 am in reply to: Are Salesforce lightning components intended for mobile apps only?

    Salesforce lightning components developing dynamic web apps for mobile and desktop devices. It’s a modern framework for building single-page applications engineered for growth.

     

     

    Thanks

  • Parul

    Member
    September 15, 2018 at 7:58 am in reply to: How Salesforce lightning component is better than visualforce page?

    Visualforce components are page-centric and most of the work is done on the server.

    Lightning is designed from the component up, rather than having the concept of a page as its fundamental unit. Lightning Components are client-side centric, which makes them more dynamic and mobile friendly.

     

    Thanks

  • Parul

    Member
    September 15, 2018 at 7:53 am in reply to: What are the different Salesforce Lightning component bundles?

    Hi,

    These are the following:

    Component, Controller, Helper, Style, Document, Design, SVG, Rendre.

     

    Thanks

  • No there is no limit.

     

     

    Thanks

  • Hi,

    Child component inherits the CSS from its aren’t we do not need to specify it for each component

     

    Thanks

  • Yes you can make a Salesforce Lightning Component that shows up in both the mobile and the desktop user interfaces with the help of Salesforce1 Mobile app, template-based communities, and custom standalone apps.

    Thanks

  • Parul

    Member
    September 15, 2018 at 7:36 am in reply to: What are the limitations of the WSDL file in Salesforce?

    A single Apex transaction can make a maximum of 100 callouts to an HTTP request or an API call.
    Only SOAP operations are considered in WSDL file.
    The maximum cumulative timeout for callouts by a single Apex transaction is 120 seconds. This time is additive across all callouts invoked by the Apex transaction.

     

    Thanks

  • Parul

    Member
    September 15, 2018 at 7:23 am in reply to: Can I integrate Salesforce lightning components with another framework?

    Yes, you can integrate lightning components with other third party framework by using tab lightning:container.

     

    Thanks

Page 42 of 53