Forum Replies Created

Page 27 of 57
  • shariq

    Member
    September 20, 2018 at 3:02 PM in reply to: What are the types of Controller in Salesforce Visualforce?

    Hi,

    There are basically two types of Controller in Visualforce page.

    1. Standard Controller
    2. Custom Controller

    Thanks

  • shariq

    Member
    September 20, 2018 at 3:02 PM in reply to: How To Get The Picklist Value In Apex Class?

    Hi,

    Using Dynamic apex, we can achieve this. On object of type pickilist, call getDescribe(). Then call the getPicklistValues() method. Iterate over result and create a list. Bind it to <apex:selectOptions>.

    Code Example:

    Let’s say we have a custom object called OfficeLocation__c. This object contains a picklist field Country__c.

    The first thing we need to do, within our controller is use the getDescribe() method to obtain information on

    the Country__c field:

    Schema.DescribeFieldResult fieldResult = OfficeLocation__c.Country__c.getDEscribe();

    We know that Country__c is a picklist, so we want to retrieve the picklist values:

    List<Schema.PicklistEntry> ple = fieldResult.gerPicklistValues();

    The only thing left for us to do is map the picklist values into an <apex:selectOptions> tag can use for display. Here is the entire method from our controller to do this:

    public List<SelectOption> getCountries()
    {
        List<SelectOption> options = new List<SelectOption>();
        Schema.DescribeFieldResult fieldResult = OfficeLocation__c.Country__c.getDescribe();
        List<Schema.PicklistEntry> ple = fieldResult.getPicklistValues();
        for( Schema.PicklistEntry f : ple)
        {
            options.add(new SelectOption(f.getLabel(), f.getValue()));
        }
        return options;
    }

    With our controller logic all complete, we can call the getCountries() method from our Visualforce page,  and populate the <apex:selectList> tag:

    <apex:selectList id=”countries” value=”{!Office_Location__c.Country__c}” size=”1″ required=”true”>
        <apex:selectOptions value=”{!countries}”/>
    </apex:selectList>

    Thanks

  • Hi,

    The object’s organization-wide default access level must not be set to the most permissive access level. For custom Objects, that is Public Read/Write.

    Thanks

  • shariq

    Member
    September 20, 2018 at 3:01 PM in reply to: Can We Change The Record Owner?

    Hi,

    Yes. In profile, there is setting for “Transfer Record”.

    Thanks

  • shariq

    Member
    September 20, 2018 at 3:01 PM in reply to: Why Keyword “without Sharing” Is Introduced In Salesforce Apex?

    Hi,

    Let’s take example, there is classA declared using “with sharing” and it calls classB method. classB is not declared with any keyword then by default “with sharing” will be applied to that class because originating call is done through classA. To avoid this we have to explicitly define classB with keyword “without sharing”.

    Thanks

  • shariq

    Member
    September 20, 2018 at 3:00 PM in reply to: What Is The Need Of “custom Controller” In Visualforce ?

    Hi,

    Sharing setting is applied on standard object/extension by default; In case we don’t want to apply sharing setting in our code then Custom controller is only option.
    It is possible that the functionality of page does not required any Standard object or may require more than one standard object, then in that case Custom controller is required.

    Thanks

  • Hi,

    To enforce Assignment Rules in Apex you will need to perform following steps:

    1. Instantiate the “Database.DMLOptions” class.
    2. Set the “useDefaultRule” property of “assignmentRuleHeader” to True.
    3. Finally call a native method on your Lead called “setOptions”, with the Database.DMLOptions instance as the argument.

    // to turn ON the Assignment Rules in Apex

    Database.DMLOptions dmlOptn = new Database.DMLOptions();

    dmlOptn.assignmentRuleHeader.useDefaultRule = true;
    leadObj.setOptions(dmlOptn);

    Thanks

  • shariq

    Member
    September 20, 2018 at 2:59 PM in reply to: Vf Page Is The Datepicker.

    Hi,

    On load event, write the javascript code to autofocus any other field or any other non-visible component.

    Example :

    <span id="focusDistraction"></span>

    <script type="text/javascript">

    /* prevent autopup of the date inputfield by the default focus behavoir */

    window.onload=function() {

    document.getElementById('focusDistraction').focus();

    }

    </script>

    Thanks

  • Hi,

    We cannot use the “Where” clause with Group By instead we will need to use the “Having Clause“.

    Example:

    Get all the opportunity where more than one record exists with same name and name contains “ABC”.

    SELECT COUNT(Id) , Name FROM Opportunity GROUP BY Name  Having COUNT(Id) > 1 AND Name like '%ABC%'

    Thanks

  • shariq

    Member
    September 20, 2018 at 2:57 PM in reply to: Will Below Query Work?

    Hi,

    Above query will throw an error.

    Explanation: In Group by clause the columns selected must be either used in Group by clause or in aggregate functions. The Name field is neither used in aggregate methods and in group by clause and hence will result in error “Malformed Query”.

    Thanks

  • Hi,

    Use component “<apex:outputText>”.

    Example : Format the number into currency.

    <apex:outputtext value="{0, number, 000,000.00}">

    <apex:param value="{!valFromController}" />

    </apex:outputtext>

    OR

    <apex:outputtext value="{0, number, ###,###.00}">

    <apex:param value="{!valFromController}" />

    </apex:outputtext>

    Thanks

  • shariq

    Member
    September 20, 2018 at 2:53 PM in reply to: If Ie9 Is Not Working With Your Custom Visualforce Page

    Hi,

    Add following metatag to pages:

    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />

    Thanks

  • shariq

    Member
    September 20, 2018 at 2:53 PM in reply to: Onchange Event Does Not Work With In Ie9. How To Resolve This Error?

    Hi,

    If we add the Header on Visualforce page then it creates lots of problem in IE9. I think there are few java-script library loaded by Header of Salesforce which makes IE9 compatible. So the best solution is to enable the Header by using “showHeader=true” in Apex page.

    Thanks

  • shariq

    Member
    September 20, 2018 at 2:52 PM in reply to: Expand CRM And Briefly Explain About CRM ?

    Hi,

    Full form for CRM or Acronym for CRM is “Customer Relationship Management “. We can understand from the full form where CRM is an application used to automate Sales and marketing functions by a using a Software called CRM Software. BY using CRM Software every Company / Organization plans to increase their revenues and profits. This strategy of increasing revenue is done mainly by attracting Customers, clients, Sales etc.

    Thanks

  • shariq

    Member
    September 20, 2018 at 2:51 PM in reply to: What Are The Advantages Of Cloud Computing?

    Hi,

    Cloud computing has made tremendous growth in processing power, reliability of the Internet and the great increase in broadband speeds.

    It makes tremendous sense to make use of the centralized server of the provider of cloud computing services as not only does it reduce the costs by a great extent by making redundant the need to buy several software licenses, it also eliminates the huge costs required by an organization to maintain and upgrade existing software.

    Thanks

  • shariq

    Member
    September 20, 2018 at 2:51 PM in reply to: What Is The Definition Of CRM?

    Hi,

    “Cloud Computing definition given by NIST (US National Institute of Standards and Technology) : Cloud Computing is a model for enabling ubiquitous, convenient, on-demand network access to a shared pool of configurable computing resources that can be rapidly provisioned and released with minimal management effort or service provider interaction“.

    Thanks

  • shariq

    Member
    September 20, 2018 at 7:51 AM in reply to: What Is Hybrid Cloud?

    Hi,

    Hybrid Cloud is the combination of number of clouds of any type but the cloud has the ability to allow data and / or applications to be moved from on cloud to another cloud. Hybrid Cloud is a combination of (Public Cloud ,Private Cloud, Community Cloud). Here API is used as an interface between public and Private Cloud.

    Thanks

  • shariq

    Member
    September 20, 2018 at 7:51 AM in reply to: Difference Between Public And Private Cloud?

    Hi,

    Public cloud can be available to people across the world. In this Public Cloud the user has no control over the resources. Where Private Cloud Can be accessed only within the limited premises. In Private cloud Cloud Services Providers Cloud infrastructure to particular Organization or Business specially. This Cloud infrastructure is not provided to others.
    Adding some points to the same ,
    Private Clouds

    Private clouds are those that are built exclusively for an individual enterprise. They allow the firm to host applications in the cloud, while addressing concerns regarding data security and control, which is often lacking in a public cloud environment.

    Public Clouds

    Public clouds are owned and operated by third-party service providers. Customers benefit from economies of scale because infrastructure costs are spread across all users, thus allowing each individual client to operate on a low-cost, “pay-as-you-go” model. Another advantage of public cloud infrastructures is that they are typically larger in scale than an in-house enterprise cloud, which provides clients with seamless, on-demand scalability.

    It is also important to note that all customers on public clouds share the same infrastructure pool with limited configurations, security protections and availability variances, as these factors are wholly managed and supported by the service provider.

    Thanks

  • shariq

    Member
    September 20, 2018 at 7:50 AM in reply to: What Is Application In SalesForce?

    Hi,

    App means an Application. In Salesforce an Application consists a group of tabs which are designed to work as a single function. We have number of applications in Salesforce.com some of them are sales, marketing, chatter, site.com, work.com etc.

    We can create new application and also customization for the existing apps in Salesforce.com. To create new app in sfdc go to Setup=>Build=>Create=>App.

    Thanks

  • shariq

    Member
    September 20, 2018 at 7:50 AM in reply to: List Examples Of Custom Field Types in Salesforce?

    Hi,

    Some of the custom field types are date field, Date/Time field, Currency field, Checkbox field, Number field, Text field, Pick list field, Email field, percent fields, phone field, Url field and many more.

    Thanks

  • shariq

    Member
    September 20, 2018 at 7:50 AM in reply to: How Many Custom Fields Can I Create In An Object?

    Hi,

    In Unlimited edition we can create up to 500 fields per object. In professional edition we can create up to 100 custom fields per object.

    Thanks

  • shariq

    Member
    September 20, 2018 at 7:49 AM in reply to: Difference Between Salesforce Role And Profile?

    Hi,

    Roles :- Using we can provide record level access like organization wide defaults, Role hierarchy, sharing rules and Manual sharing. Simply roles influences record level access. Role is nothing but hierarchy in the org. while creating the user profile is mandatory but profile is not mandatory.

    Profiles :- Using  profile object level and field level access can be made like general permissions, tab level permissions, read & write permissions etc. Profile is nothing but What type of Permission will give to users, We have many types of permissions i.e. general permission ,tab level permission,object level permission,read&write permission,record type permission.

    Thanks

  • shariq

    Member
    September 20, 2018 at 7:48 AM in reply to: Which Fields Are Indexed By Default In Salesforce?

    Hi,

    Salesforce indexed some fields by default they are Id, name, owner fields, lookup fields, master-detail relationship fields, audit dates like Last Modified dates.

    Thanks

  • shariq

    Member
    September 20, 2018 at 7:45 AM in reply to: Best Practices Of Creating Contact Sharing Rules in Salesforce?

    Hi,

    Organization wide default settings are used to set read, write, read/write permissions.

    Thanks

  • Hi,

    It is not possible , by default Grant Access Using Hierarchies options are enabled for standard objects and they can not be changed.For custom objects we can change “Grant Access Using Hierarchies “settings .

    Thanks

Page 27 of 57