Forum Replies Created

Page 12 of 53
  • Parul

    Member
    September 23, 2018 at 6:04 am in reply to: Explain Considerations for Static keyword in Salesforce Apex.

    static: This keyword defines a method/variable that is only initialized once, and is associated with an (outer) class, and initialization code. We can call static variables/methods by class name directly. No need of creating instance of a class.

  • Have you looked at the “View and Edit Converted Leads” permission? A user with that permission can view the actual record of a converted lead. Without the permission when you click on a converted lead you will automatically be navigated to the contact or account.

    Thanks

  • if(trim($_POST['message']) == '') {
    $hasError = true;
    } else {
    if(function_exists('stripslashes')) {
    $comments = stripslashes(trim($_POST['message']));
    } else {
    $comments = trim($_POST['message']);
    }
    $comments = nl2br($comments);
    }

  • actionFunction: It is used to call the server side method using javaScript.

    actionSupport: It is used to call the server based on the client side event i.e. like onclick, onchange etc.

    actionPoller: It is used to call the server side method in a regular interval of time.

    actionRegion: An area of a Visualforce page that demarcates which components should be processed by the Force.com server when an ajax request is generated.

    Thanks

  • Apex:dataTable – An HTML table that is defined by iterating over a set of data, displaying information about one item of data per row.  The data set can include up to 1,000 items.->no need to write inside <apex:pageblock> or <apex:pageblocksection>
    -> there is no required value
    -> the data can be displayed using custom styles
    -> we need to specify column headers explicitly

    Apex:pageBlockTable – A list of data displayed as a table within either an < apex:pageBlock > or < apex:pageBlockSection > component, similar to a related list or list view in a standard Salesforce page. Like an < apex:dataTable >, an < apex:pageBlockTable > is defined by iterating over a set of data, displaying information about one item of data per row. The set of data can contain up to 1,000 items.The body of the

    < apex:pageBlockTable > contains one or more column components that specify what information should be displayed for each item of data, similar to a table. Unlike the < apex:dataTable > component, the default styling for < apex:pageBlockTable > matches standard Salesforce styles.

  • Create a new Button on Lead of type List Button and then Add the button on Lead List View Layout.

  • Global session variable is available in VF page so when we create a visualforce page with output type as JavaScript first initialize the global javascript variable in that VF page and then include VF page as a javascript file I think then it avoided.

  • Objects are passed by instance so the value is changed in custom component we will get updated value in controller also.

    Thanks

  • Adderror()  is not a statement its execution method and a flow and all the code written inside the method will executed.

  • Parul

    Member
    September 23, 2018 at 5:35 am in reply to: How to clear the Time based workflow action queue in Salesforce?

    Create criteria false for all the records by using the checkbox or by removing the queue from Time based workflow action queue

  • There's no supported way to detect that a user is masquerading as another user via Grant Login Access. I have seen some suggestions around cookie sniffing, but as you want to restrict access I'd say that would be a very fragile.

  • Using isPersonAccount property on an Account and catch any exception that occurs if that property is missing. If an exception is generated then person accounts are disabled. Otherwise they’re enabled. To avoid making person accounts required for the package you assign the Account object to an sObject and use sObject.get( ‘isPersonAccount’ ) rather than accessing that property directly on the Account object.

    Thanks.

  • If you're running a trigger on objects that have more than 200,000 records, it's possible that you'll receive the error, "System.QueryException: Non-selective query against large object type." We'll go over the a few possible fixes. Resolution.
    Options to resolve error.

  • Parul

    Member
    September 23, 2018 at 5:08 am in reply to: Can you use Group by clause inside inner query in Salesforce SOQL?

    SELECT Id, Name,(SELECT Count(Id),Name FROM Contacts Group By Name Having count(Id) > 1 ) FROM Account

    No only root queries support aggregate expression.

  • Hi

    Yes you can implement pagination in Visualforce as follows:

    <apex:pageblockSection >
    <apex:outputPanel id=”myPanel”>
    <apex:PageBlockTable var=”c1″ value=”{!cnd}”>
    <apex:column headerValue=”First Name”>
    <apex:inputField value=”{!c1.First_Name__c}”/>
    </apex:column>
    <apex:column headerValue=”Last Name”>
    <apex:inputField value=”{!c1.Last_Name__c}”/>
    </apex:column>
    <apex:column headerValue=”City”>
    <apex:inputField value=”{!c1.City__c}”/>
    </apex:column>
    <apex:facet name=”footer”>Showing Page # {!pageNumber} of {!totalPages}</apex:facet>
    </apex:PageBlockTable>
    </apex:outputPanel>
    </apex:pageblockSection>

     

    Thanks

  • Hi,

    Adding some code snippet

    Here is a static method that accepts a desired string length as an argument. It takes a full string of ASCII numbers and letters and loops through the index of your desired string length, randomly choosing an index in the full character string.

    public static String generateRandomString(Integer len) {
    final String chars = ‘ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz’;
    String randStr = ”;
    while (randStr.length() < len) {
    Integer idx = Math.mod(Math.abs(Crypto.getRandomInteger()), chars.length());
    randStr += chars.substring(idx, idx+1);
    }
    return randStr;
    }

     

    Thanks

  • Parul

    Member
    September 23, 2018 at 5:05 am in reply to: What is Dynamic Binding in Salesforce?

    Dynamic Visualforce Bindings means fields on the page are determined at run time, rather than compile time.
    Use them on a page like this:

    {!reference[expression]}

    Static Bindings means fields on the page are determined at compile time.

  • Parul

    Member
    September 23, 2018 at 5:04 am in reply to: How to convert lead using Salesforce Apex?

    Public class LeadClass{
    public static void doConvert(Id leadId){

    Database.LeadConvert lc = new database.LeadConvert();
    lc.setLeadId(leadId);
    lc.setDoNotCreateOpportunity(True);

    LeadStatus convertStatus = [SELECT Id, MasterLabel FROM LeadStatus WHERE IsConverted=true LIMIT 1];
    lc.setConvertedStatus(convertStatus.MasterLabel);
    Database.LeadConvertResult lcr = Database.convertLead(lc);
    }
    }

     

    Thanks

  • you can manually check it that the email could use from setup menu under monitoring. From the email log page: “Email logs describe all emails sent through salesforce.com and can be used to help identify the status of an email delivery.

  • With apex trigger or in class  you cannot change the currency field type to numeric type.

  • Parul

    Member
    September 23, 2018 at 4:58 am in reply to: How to add the Document Header in Salesforce Visualforce page?

    I am trying to do something on similar lines. Tried using the tags mentioned in the thread but it throw an error

  • Parul

    Member
    September 23, 2018 at 4:57 am in reply to: How to achieve the below given command line using Salesforce Apex?

    This will tell IE9 that you would prefer it operate like IE8, and IE8 still works fine.  However, I believe this meta tag needs to be one of the first things declared in the page, and under some situations (like showHeader=true) you may not have control over that.  In that case, you can add the following to the Apex controller:

    Apexpages.currentPage().getHeaders().put('X-UA-Compatible', 'IE=8');
    Remember that Apex controllers can also be served up as extensions to other custom controllers or standard controllers – so if you need to add this to several pages but don't want to rewrite the constructor of each controller, you can add one extension, place the above in the constructor – and then add the extension to existing pages without having to manipulate a lot of existing Apex.

  • code snippet

    <td style="white-space:nowrap;">
    <apex:inputText value="{0,StartDateTime,MM'/'dd'/'yyyy}" disabled="true" >
    <apex:param value="{!evento.StartDateTime}" />
    <apex:inputText>
    </td>

  • Formatting, grouping and subtotals are persisted by Printable view.

    formatting, grouping and subtotals are lost by Export Details

  • When creating user there are number of license but System administrator is not for new user then copy from the "Standard user" profile.

     

    Thanks

Page 12 of 53