Forum Replies Created

Page 37 of 53
  • Parul

    Member
    September 17, 2018 at 11:58 am in reply to: Auto Populate page of Opportunity Record on Custom Button

    Hello,

    For this, you can create a visualforce page and use it on the custom button on Opportunity, and in the controller of that VF page, you can get all the values you want on the new page on click of button.

    Thanks.

     

  • Parul

    Member
    September 17, 2018 at 11:56 am in reply to: Lead Conversion

    Hello,

    You can query on Lead with filter of: isconverted

    Example: select id, name, isconverted from lead where isconverted = true

    Hope this helps you.

    Thanks.

  • Parul

    Member
    September 17, 2018 at 11:51 am in reply to: Lead convert creating duplicate contact, Account and Opportunity

    Hi,

    Once the lead is entered in salesforce and at the point where the user is about to convert the lead , creating an intermediate visual force page would help to check for minimal fields to be entered on the lead so that the converted lead would have relevant data. Fields like phone number or email id, description fields are examples of these lead fields. The visual force solution would make sure that all these minimal fields are filled and required and once the data is filled in, the conversion solution can be triggered to convert the lead to account and contact.

    Thanks.

  • Parul

    Member
    September 17, 2018 at 11:49 am in reply to: Issues with Custom Buttom in a Salesforce Opportunity

    Hello,

    Basically, you need to develop a logic in which a custom button is shown when Stage is 'Closed Won' else hide the custom button.

    Rest of the code, @Aman has already provided to you.

    Hope this helps you to understand the problem.

    Thanks.

  • Parul

    Member
    September 17, 2018 at 11:43 am in reply to: How can i write a Salesforce trigger for below given scenario ?

    Hi,

    Here is the code I tried and got success:

    trigger opporTrigger on Opportunity (after update) {

    List<Opportunity> oppor = [select id, name, description, stagename, (select id, name from OpportunityContactRoles) from opportunity where id in: Trigger.new];
    for(Opportunity opp:oppor){
    if(opp.OpportunityContactRoles.size() ==0 && opp.StageName==’closed Won’){
    opp.addError(‘error’);
    }
    }
    }

    Hope this helps you.

    Thanks.

  • Parul

    Member
    September 17, 2018 at 11:40 am in reply to: How to delete child records in lookup relation (with Salesforce triggers)

    Hi,

    Please find the below code:

    trigger DeleteChildrenFromOppty on Opportunity (before insert, before update, after insert, after update) {

    if(Trigger.isAfter && Trigger.isUpdate){
    set<Id> setOpportunityIds = new set<Id>() ;
    for(Opportunity opp : Trigger.new){
    if((!opp.isWon && opp.isClosed) && !(!Trigger.oldMap.get(opp.Id).isWon && Trigger.oldMap.get(opp.Id).isClosed)){
    setOpportunityIds.add(opp.Id) ;
    }
    }
    if(!setOpportunityIds.isEmpty())
    delete([SELECT Id from Object_A__c WHERE Opportunity__c IN: setOpportunityIds]) ;
    }
    }

    Hope this helps you.

    Thanks.

     

  • Hi Anurag,

    There is no term 'Bound Variable' in salesforce, rather it is BIND variable.

    The BIND variable is the variable name TIED with the controller.

    Using the standard controller (<apex:page standardController="Contact">) and referencing it as {! Contact.FirstName } would be accepted as solution.

    Use global variables to reference general information about the current user and your organization on a page.
    Global variables must be referenced using Visualforce expression syntax to be evaluated.

    For example:  {!$User.FirstName}.

    Hope this helps.

    Thanks

  • Parul

    Member
    September 17, 2018 at 11:13 am in reply to: What are the types of email templates available in salesforce.com?

    Hi,

    You can create four different types of email templates:

    1. Text
    2. HTML with Letter Head
    3. Custom HTML
    4. Visual force

    1) Text – All users can create or change text email templates.
    2) HTML with letterhead – Administrators and users with the “Edit HTML Templates” permission can create HTML email templates based on a letterhead.
    3) Custom HTML – Administrators and users with the “Edit HTML Templates” permission can create custom HTML email templates without using a letterhead. You must either know HTML or obtain the HTML code to insert in your email template.
    4) Visualforce – Administrators and developers can create templates using Visualforce. Visualforce email templates allow for advanced merging with a recipient’s data, where the content of a template can contain information from multiple records.

    Thanks.

  • Parul

    Member
    September 17, 2018 at 11:10 am in reply to: What are responsive email templates in Salesforce?

    Hi Shradha,

    Responsive templates use CSS to resize your emails when viewed on mobile devices. For responsive email template you have to create visualforce email template that is the only solution to make it responsive.

    Hope this helps.

    Thanks.

  • Parul

    Member
    September 17, 2018 at 11:06 am in reply to: Why Account Field is not populated in Email Template ?

    Hello Parv,

    When using merge fields for email templates the email is restricted to the object it is being sent from. You cannot reference a parent objects fields. So, you need to create a visualforce template instead of standard template.

    Hope this helps.

    Thanks.

  • Parul

    Member
    September 17, 2018 at 10:49 am in reply to: Heap size limit exceeded

    Hi Abhinav

    To avoid this error,Please review your code and follow best practices to ensure that the heap limit does not exceed the maximum.

    Note -: Salesforce enforces an Apex Heap Size Limit of 6MB for synchronous transactions and 12MB for asynchronous transactions, and if you exceed that limit, you will receive an error message.

    Thanks

     

  • Parul

    Member
    September 17, 2018 at 10:28 am in reply to: How to delete custom object programmatically?

    Hi Hajel

    We can't delete a custom Object.Instead we delete a record of custom Object.For perform deletion of Custom Object we have to use Metadata API

    Thanks

  • Parul

    Member
    September 17, 2018 at 7:12 am in reply to: is Undelete Operation is count as DML

    Ye, it is every DML operation counts.

     

    Thanks

  • Parul

    Member
    September 17, 2018 at 6:49 am in reply to: Where we use application custom event in Salesforce?

    Custom application event using the <aura:event> tag in a .evt resource.Events can contain attributes that can be set before the event is fired and read when the event is handled. Application events follow a traditional publish-subscribe model. An application event is fired from an instance of a component.

     

    Thanks

  • Yes we can execute two components in single app easily.

     

     

    Thanks

  • Parul

    Member
    September 17, 2018 at 6:47 am in reply to: Why future method is void and static in Salesforce?

    The future method is void and static because:

    use of future methods to isolate DML operations on different sObject types to prevent the mixed DML error. Each future method is queued and executes when system resources become available. That way, the execution of your code doesn’t have to wait for the completion of a long-running operation. A benefit of using future methods is that some governor limits are higher, such as SOQL query limits and heap size limits

    NOTE :-
    1) Methods with the future annotation must be static methods
    2) can only return a void type
    3) The specified parameters must be primitive data types, arrays of primitive data types, or collections of primitive data types
    4) Methods with the future annotation cannot take sObjects or objects as arguments.
    5) You can invoke future methods the same way you invoke any other method. However, a future method can’t invoke another future method
    6) No more than 50 method calls per Apex invocation
    7) Asynchronous calls, such as @future or executeBatch, called in a startTest, stopTest block, do not count against your limits for the number of queued jobs
    8) The maximum number of future method invocations per a 24-hour period is 250,000 or the number of user licenses in your organization multiplied by 200, whichever is greater
    9) To test methods defined with the future annotation, call the class containing the method in a startTest(), stopTest() code block. All asynchronous calls made after the startTest method are collected by the system. When stopTest is executed, all asynchronous processes are run synchronously

     

     

    Thanks

  • Parul

    Member
    September 17, 2018 at 6:46 am in reply to: What is Content version ??? How we get id of content version ???

    ContentVersion
    Represents a specific version of a document in Salesforce CRM Content or Salesforce Files. This object is available in versions 17.0 and later for Salesforce CRM Content documents. This object is available in versions 20.0 and later for Salesforce Files.

     

    Thanks

  • You can check using debug log then you will find error in it because code is correct.

     

    Thanks.

  • You can check using debug log then you will find error in it.

     

    Thanks.

  • Parul

    Member
    September 17, 2018 at 6:44 am in reply to: How to deactivate flow through WorkBench?

    You can use Workbench feature and then deactivate flow through metadata when a process is installed using a managed package and that process references a custom object that isn't in the target org. In this case, the process is active and can't be edited using the Process Builder.
    Resolution
    Follow these steps to deactivate a process.

    1. Log into Workbench. Read more here about Workbench.

    2. Use Workbench to retrieve metadata components and then download those components in a .zip file.
    Read about Metadata for more information.

    3. Modify the flowDefinition file (contained in the .zip file you downloaded) by specifying a value of 0 in activeversionNumber.
    Note that the flowDefinition file is available only in API version 34 and later.

     

    use the above link

    Thanks

  • Parul

    Member
    September 17, 2018 at 6:41 am in reply to: What is the use of apex:facet in Salesforce Visualforce?

    <apex:facet>:
    A placeholder for content that is rendered in a specific part of the parent component, such as the header or footer of an < apex:dataTable >.

    An < apex:facet > component can only exist in the body of a parent component if the parent supports facets. The name of the facet component must match one of the pre-defined facet names on the parent component. This name determines where the content of the facet component is rendered. Consequently, the order in which a facet component is defined within the body of a parent component does not affect the appearence of the parent component.

  • Parul

    Member
    September 17, 2018 at 6:40 am in reply to: how we can edit the description of account through Salesforce Apex code?

    List<Account> = new List<Account>();

    Account a = new Account(
    Id = acc.Id,
    RecordTypeId = rt.Id
    );
    AccListToBeUpdated.add(a);

    May be it helps

    Thanks.

  • Parul

    Member
    September 17, 2018 at 6:39 am in reply to: Where do we use apex:detail and apex:inlineeditsupport in Salesforce?

    <apex:detail>:
    The standard detail page for a particular object, as defined by the associated page layout for the object in Setup. This component includes attributes for including or excluding the associated related lists, related list hover links, and title bar that appear in the standard Salesforce application interface.

    <apex:page standardController="Account">
    <apex:detail subject="{!account.ownerId}" relatedList="false" title="false"/>
    </apex:page>

    With using <apex:inlineEditSupport /> you can enable inline edit only on certain fields and not on entire block and so you can use dependent picklists and lock certain fields from inline editing within the pageblock.

     

    Thanks

  • Parul

    Member
    September 17, 2018 at 6:25 am in reply to: What is the use of apex:detail component in Salesforce?

    Hi

    <apex:detail>:
    The standard detail page for a particular object, as defined by the associated page layout for the object in Setup. This component includes attributes for including or excluding the associated related lists, related list hover links, and title bar that appear in the standard Salesforce application interface.

    Visualforce page:

    <apex:page controller="Sample">
    <apex:form >
    <h1>Below is the Account detail</h1>
    <apex:detail subject="{!AccountId}" relatedList="false"/>
    </apex:form>

    </apex:page>

    Apex Controller:

    public class Sample {
    public Id AccountId {get;set;}

    public Sample() {
    AccountId = '0019000001BoVNx';
    }
    }

    thanks

  • Hi

    These are the AJAX action tags that support the calling of action and refresh the field only not the entire Visualforce page.

    1. <apex:actionFunction> - Provides support for invoking controller action methods directly from JavaScript code using an AJAX request. An <apex:actionFunction> component must be a child of an <apex:form> component.

    1. Both action support and function can be used to call a controller method using an AJAX request.
    * for example call controller onclick of a inputcheck box
    * or call a controller method onfocus of a input field
    Well, they both do the same thing of calling controller method.

    Difference between both:

    1. Action function can call the controller method from java script.
    2. Action support adds AJAX support to another visualforce component and then call the controller method.
    for example:

    <apex:outputpanel id="outptpnl">
    <apex:outputText value="click here"/>
    <apex:actionSupport event="onclick" action="{!controllerMethodName}"  rerender="pgblck" />
    </apex:outputpanel>

    Here action support adds AJAX to output panel, so once you click on output panel controller method will be called.

    3. Action function cannot add AJAX support to another component. But from a particular component which has AJAX support(onclick, onblur etc) action function can be called to call the controller method.
    Example:

    <apex:actionFunction name="myactionfun"  action="{!actionFunMethod}" reRender="outptText"/>
    <apex:inputcheckbox onclick="myactionfun" />

     

     

    Thanks

     

Page 37 of 53