• Swayam@SalesforceGuy
  • SMARTIE
  • 845 Points
  • Member since 2015
  • Salesforce Consultant


  • Chatter
    Feed
  • 25
    Best Answers
  • 0
    Likes Received
  • 2
    Likes Given
  • 0
    Questions
  • 181
    Replies
Hi

I have a visualforce page with an extension controller which shows and works as expected on the account detail page layout.

However, I'd like to also show my VF page on the page layout that is shown when the user clicks the "New" button. I.e. on the create/insert page layout.

How can this be done?

Thanks in advance.

/Søren Nødskov
I'm trying to create a VF page to launch a flow, but I can't get past this error after hitting the save button:
Error: <apex:component> is required and must be the outermost tag in the markup at line 1 column 1
Here is my VF page:
<apex:page standardController="Opportunity">
    <flow:interview name="New_Quote_Wizard" finishLocation="{!URLFOR('/a1m')}">
        <apex:param name="OppID2" value="{!Opportunity.Id}"/>
    </flow:interview>
</apex:page>

I'm following th example in the documentation, and this video: https://www.youtube.com/watch?v=FRdyCLJ-4l4 (timestamp: 28:11)
Hi,

I'm writing a button on a Case page that
1. gets some values from the local Case:
var name = "{!Case.Subject}";

2. Puts them into an Apex call to create a different object.
3. should write some stuff back into the local case, so
{!Case.Project__c} =  project;

...which does not work.

So what is the way to set the local record's fields in Javascript?

Thanks!

Cheers,
Thorsten

Hi all. A sandbox was created within my company before I started working here. The person who made it is no longer with the company. My boss refreshed the sandbox, so now I am able to login but it wants me to verify my identity. I'm not sure what email address the verification code is going to since I can't enter my real email address when logging into sandbox. Any suggestions on this? 
Getting Error when trying to blank out a Lookup field once a trigger has run to insert Opportunity Team Member.Below is a trigger I wrote to create an Opportunnity Team Member when a lookup field called Secondary Owner is updated. The issue is when I try and blank out the lookup (Say if the secondary owner was input incorrectly) I get the following error. 
 
Error: Apex trigger OTOpportunityTrigger caused an unexpected exception, contact your administrator: OTOpportunityTrigger: execution of BeforeUpdate caused by: System.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [User]: [User]: Trigger.OTOpportunityTrigger: line 13, column 1

Below is my trigger
trigger OTOpportunityTrigger on Opportunity (before update) {
    List<OpportunityTeamMember> listOpptyTeamMem = new List<OpportunityTeamMember>();
    
    for(Opportunity oppty : trigger.New){
        OpportunityTeamMember OTM = new OpportunityTeamMember();
        OTM.OpportunityId = oppty.Id;
        OTM.TeamMemberRole = 'Secondary Owner'; 
        OTM.UserId = oppty.Secondary_Owner__c;
        listOpptyTeamMem.add(OTM);   
        
       
            if(listOpptyTeamMem.size() > 0){
        insert listOpptyTeamMem;
       
         
        // get all of the team members' sharing recordsPost to Community
        List<OpportunityShare> shares = [select Id, OpportunityAccessLevel, 
          RowCause from OpportunityShare where OpportunityId = :oppty.Id
          and RowCause = 'Team'];
 
        // set all team members access to read/write
        for (OpportunityShare share : shares) 
          share.OpportunityAccessLevel = 'Edit';
 
        update shares;
    }
}
}

and here is my test class
 
@isTest(SeeAllData=true)
public with sharing class TestOTOpportunityTrigger {

    public static testmethod void test_1() {
             
            //create test account
            Account a  = new Account();
            a.name     = 'Teston';
            insert a;

            //create test opportunity 
            
        Opportunity o  = new Opportunity();
        o.OwnerID = '005i0000004LFZH';
        o.Name = 'Test';
        o.AccountID = '001i000001mCGvY';
        o.Unit_Number__c = 'a01i000000YWLGK';
        o.Financing_Type__c = 'Cash Buyer';
        o.Nature_of_Tenancy__c = 'Severalty';
        o.Sale_Type__c = 'Founder';
        o.CloseDate = Date.today();
        o.stageName = 'S1: Ready to Contract';
        o.Secondary_Owner__c = '005i0000004LFZH';
        
        
        insert o;
        
        OpportunityTeamMember OTM = new OpportunityTeamMember();
        OTM.OpportunityId = o.Id;
        OTM.TeamMemberRole = 'Secondary Owner'; 
        OTM.UserId = o.Secondary_Owner__c;   
        

            
            insert OTM;
             
             
            List<OpportunityTeamMember> OTMs = [SELECT id, UserId, OPPORTUNITYACCESSLEVEL
                                                FROM OpportunityTeamMember
                                                WHERE OpportunityId =: otm.Id
                                                ];
         
             
             
            //update O to execute the trigger
            update otm;
             
            //re-query
            OTMs = [SELECT id, UserId, OPPORTUNITYACCESSLEVEL
                    FROM OpportunityTeamMember
                    WHERE OpportunityId =: otm.Id
                    ];
             

        }

    }

 
I'd like to create a VF page, add it to lightning and display on this VF Page a Public Calendar. In Classic I can see it, In Lightning I see: This page isn't available in Salesforce Lightning Experience or Salesforce1. This is dispite having checked off to enable the page in lightning. 

My assumption is that there is no custom way to display a public calendar in Lightning at the moment. Is that a correct assumption or is their a potential workaround that could be explored. I'm might be S.O.L. but i wanted to confirm. I realize that the standard out of box method does not allow for users to see public calendars in lightning. I was experimenting to see if their was a custom solution to this. 

Many thanks for reading my note. 
Hi, 
I need to schedule following code:
tempuriOrg.QantelDataServiceEndPoint NewTempUri= new tempuriOrg.QantelDataServiceEndPoint();

      NewTempUri.ProcessWarehouseInventory('username','password');

I was wondering if someone could recommend me the best way to schedule. Should  I create a new class that implements Schedulable 
Any suggestions?
I completed the entire samples on ContactList.vsp as directed, and with no Problems but after Saving it many times, the Pagination does not show on preview.  Please let me know if you see any errors.  All the code snippets were copied from the Trailhead Module.  Here's the code:

<apex:page standardController="Contact" recordSetVar="contacts">
    <apex:form >
        <apex:pageBlock title="Contacts List" id="contacts_list">
            
            Filter: 
                <apex:selectList value="{! filterId }" size="1">
                 <apex:selectOptions value="{! listViewOptions }"/>
                <apex:actionSupport event="onchange" reRender="contacts_list"/>
                </apex:selectList>
            
            <!-- Contacts List -->
            <apex:pageBlockTable value="{! contacts }" var="ct">
<!-- Pagination -->
<table style="width: 100%"><tr>

    <td>
Page: <apex:outputText value=" {!PageNumber} of {! CEILING(ResultSize / PageSize) }"/>    </td>            

    <td align="center">
<!-- Previous page -->
<!-- active -->
<apex:commandLink action="{! Previous }" value="« Previous"
     rendered="{! HasPrevious }"/>
<!-- inactive (no earlier pages) -->
<apex:outputText style="color: #ccc;" value="« Previous"
     rendered="{! NOT(HasPrevious) }"/>

&nbsp;&nbsp;  

<!-- Next page -->
<!-- active -->
<apex:commandLink action="{! Next }" value="Next »"
     rendered="{! HasNext }"/>
<!-- inactive (no more pages) -->
<apex:outputText style="color: #ccc;" value="Next »"
     rendered="{! NOT(HasNext) }"/>
    </td>
    
    <td align="right">
Records per page:
<apex:selectList value="{! PageSize }" size="1">
    <apex:selectOption itemValue="5" itemLabel="5"/>
    <apex:selectOption itemValue="20" itemLabel="20"/>
    <apex:actionSupport event="onchange" reRender="contacts_list"/>
</apex:selectList>
    </td>

</tr></table>

                <apex:column value="{! ct.FirstName }"/>
                <apex:column value="{! ct.LastName }"/>
                <apex:column value="{! ct.Email }"/>
                <apex:column value="{! ct.Account.Name }"/>
            </apex:pageBlockTable>
         
        </apex:pageBlock>
     </apex:form>
</apex:page>
The Spring '16 preview had been applied to our Sandbox.  A design refresh from our production version was applied to the Sandbox.  How can we get the the Spring '16 preview back?
I have the following class and visualforce page created, so when the button is pressed, the record owner is updated. I would like to add this button to the detail page like the button below. Can anyone help? 

User-added image

Class: 
public class classSubmitToLegal {

    public Agreement_Request__c a{get;set;}
    public classSubmitToLegal() {
     a = new Agreement_Request__c ();
     a = [select Business_Unit__c from Agreement_Request__c Where Id=: ApexPages.currentPage().getParameters().get('Id')];
    }
    
    public void someMethod() {
      if(a.Business_Unit__c == 'EIS') {
         a.OwnerID ='00G18000000ZRlS';
         update a;
          Apexpages.Message errorMessage = new Apexpages.Message(ApexPages.Severity.Info,'You have changed the owner');
          Apexpages.addMessage(errorMessage);
      } else {
          Apexpages.Message errorMessage = new Apexpages.Message(ApexPages.Severity.Info,'You cannot update');
          Apexpages.addMessage(errorMessage);
      }
    }

}

VF Page:
 
<apex:page controller="classSubmitToLegal"> 
<apex:form>
<apex:commandButton action="{!someMethod}" value="Submit To Legal" id="Submit_to_Legal__c"/>
</apex:form>
</apex:page>

 
I'm trying to move an Apex class from Sandbox to Production. I need to use records from "Activities" in a SOQL query. The problem is that my Sandbox doesn't have "Activities" sObject but production does. When I try to use "Activities" sObject in the sandbox it throws an error. I have to use the sObject "Activities" before moving it to Production coz I won't be able to add new/edit a Apex Class in Production.

Appreciate any help. Thanks
I'm new to Salesforce and I'm trying to automate report generation. Basically every time I want that specific report, I want it to be directly generated in Excel Realtime. What is the best way of doing this?

Is it by using Apex classes to run the SOQL query and VisualForce page to create an Excel report?

Are there other ways of doing it?

Thanks in advance.
Hello team, I have a simple code such as following: 
public void showQuery()
    {
        try
        {
            //try something
            If(Success)
            {
                //Show JavaScript success message
            }
            else
            {
                //Show JavaScript missing something
            }
        }
        catch(Exception e)
        {
            //Show JavaScript code of error
        }
    }

How can I show a this JavaScript from code?
Thanks a lot in advance
Hi,

our developer has created this apex class on custom object (Invoice Client) so we can track field history tracking . On this object  when we change status__c field then history is captured. We want to track history for other fields too. What is the easiest way to inlcude other fields so we can track history on it?
public with sharing class invoice 
{       
    private final string sFieldHistoryTrackObjName = 'Invoice_client';
    private final string sFieldHistoryTrackFldName = 'Status__c';  
    
    
 
    public string sHistoryTrackObjectName
    {
        get
        {
            return sFieldHistoryTrackObjName;
        }
    
    }
   
    public List<string> HistoryTrackFieldName
    {
        get
        {
            
            return new string[]{sFieldHistoryTrackFldName};
        }
    
    } 
}

Thanks.
Richa
I would like to add a button to existing menu that will link me to the contracts page in Salesforce.

Please give any relevant expertise.
I'm sure this must be a common requirement but I haven't been able to find what I need.

I have a Visualforce page with a standard controller.  The user updates one field on that page then clicks a button to update the record and then display a different visualforce page with a custom controller which uses the value that has just been updated.

How can I ensure that the first update has completed before the new page is displayed?

I originally had two buttons, one to 'Update' and one to display new page.  However, I fear impatient users will continue before the update has completed, so want to combine into one and bake in the control.  I have used a Javascript function to pass parameters and display the second page.

Thanks,
Mike.
Hi Team 

I have couple of question here which are 

* can some one tell me how to write test class for restfull integration,if interviewr asked what should i tell them? 

* In REST integration beofre sending request to external web service,where do we need to make entry for Rest integration, Is iit do i need to enable API? 

* Finaly on which basis I can go for Rest integration instead SOAP API I mean how to decide ?



 
I have a visualforce page that I am rendering as PDF. I have a formula (currency) that displays like 1.02E+7 instead of the correct amount. I am using HTML {!Opportunity.Profit__c}. If I use <apex:outputField Value .....> , it displays correct but than it messes up my alignment. Any advice?
Guys, i am trying to write a test class for a simple save method.
This might be simple, but i cannot get this correct!!!

Apex Class -

public with sharing class ExtUpdated {
ApexPages.StandardController stdcontroller ;
    public ExtUpdated(ApexPages.StandardController controller) {
    stdcontroller = controller;    }
public PageReference todo(){
stdcontroller.save();
return (new pagereference('/apex/confirm').setredirect(true));}}

Test Class -

@isTest
public class TestExtUpdated {
    static testMethod void saveNewCase() {
Case co = new Case();
        insert co;
        Test.startTest();
PageReference pageRef = Page.MyVFPage; // Add your VF page Name here
Test.setCurrentPage(pageRef);
ApexPages.StandardController sc = new ApexPages.StandardController(co);
sc.save();
Test.stopTest();
}}

No errors, but the test coverage is 0%.

Thanks for your help!!!
Hi

I have a visualforce page with an extension controller which shows and works as expected on the account detail page layout.

However, I'd like to also show my VF page on the page layout that is shown when the user clicks the "New" button. I.e. on the create/insert page layout.

How can this be done?

Thanks in advance.

/Søren Nødskov
Hi,

We are getting the error "System.CalloutException: IO Exception: DER input, Integer tag error" we we try to integrate with one of the external system from SFDC.

We went through below blog and followed the exact steps but still we are gettign the above error.
https://developer.salesforce.com/forums/?id=906F00000009BAyIAM

Thanks,
Pallavi
  • August 09, 2016
  • Like
  • 1
Hi All

Im trying to alert based on a picklist, my example is below. 
My understanding is that this should work... Is there something im missing?
 
<apex:page StandardController="Opportunity">

    <script>
    
        if({!Opportunity.StageName}=="Contract Signed")
        
            alert('Alert Box');
            
    </script>

</apex:page>

 
private Opportunity currentOpp;

    public ConvertOppToProjectControllerExtension(ApexPages.StandardController stdController) {
        this.currentOpp = (Opportunity)stdController.getRecord();
    }
    
    public ConvertOppToProjectControllerExtension(Opportunity currentOpp) {
      this.currentOpp = currentOpp;
    }

      currentOpp = [SELECT Id, Abbreviation__c, AccountId, CloseDate, Name, OwnerId, Probability, Description, StageName, Portfolio__c,
              NextTaskNumber__c, Company__c, Service_Type__c, AM_Sales_Ops__c,
                (SELECT Name, Approved__c, Opportunity__c, Estimate_Total_Dollars__c FROM Estimates__r)
          FROM Opportunity
          WHERE Id = :currentOpp.Id];

      //Convert the Opportunity itself
      currentOpp.StageName = 'Closed Won';
      currentOpp.CloseDate = System.now().date();      
      Database.update(currentOpp);

We have the Closed Won stage set at 100% Probability. If we manually move the Oppty to Closed Won and save, the Probability updates to 100% jsut fine. But when using the code below, it updates the stage correctly but the Probability remains where it was. We have this working in our Prod instance, but we're attempting some stage renames (probabilities staying the same - and not changing Closed Won), but it's not updating the Probability field.

 
Hi, 

I have created an Visualforce page that generates an PDF of a opportunity on a click of a button in opportunity layout. Now I want to be able to save that PDF as an attachment in opportunity and also have an option to send that PDF as an email attachment within salesforce. Here is my VF page -
 
<apex:page standardController="Opportunity" renderAs="pdf" applyBodyTag="false" > 
    <html> 
        <apex:form >
        <apex:pageBlock >
        <center>
         <table width="100%" style="font-family: Arial, Helvetica, sans-serif; border-collapse: collapse;" cellpadding="5">
        
        <head>
       
            <tr>
                <td colspan="4" >
                    <img src="some img" ></img> 
                </td>
            </tr> 
        </head>
       
        <body>
           
            <tr>
                <td colspan="4" style="font-size: x-large; font-weight: bold">
                    {!Opportunity.Account.Name}
                </td>
            </tr>
          
            <tr>
                <td colspan="4"> </td>
            </tr>
            <tr>
                <td colspan="4" style="font-weight: bold; border-bottom-style: solid; border-bottom-width: thick;
                    border-bottom-color: #30b55a;">
                    Campaign Information </td>
            </tr>
              
                    <tr>
                            <td align="left" style="color: #808080; border-right-style: solid; border-right-width: thin;
                    border-right-color: #30b55a;">
                                Campaign Name </td>
                            <td align="left" style="padding-left: 5px;"> 
                                {!Opportunity.Name} </td>
                                
                        </tr>
                   <tr>                    
                            <td align="left" style="color: #808080;border-right-style: solid; border-right-width: thin;
                    border-right-color: #30b55a;">
                                Brand </td>
                            <td align="left" style="padding-left: 5px;">
                                {!Opportunity.Account.Name} </td>
                        </tr>
                       
            <tr>
                <td align="left" style="color: #808080; border-right-style: solid; border-right-width: thin;
                    border-right-color: #30b55a;">
                    Start Date
                </td>
                    <td style="font-weight: normal; padding-left: 5px;">
                        <apex:outputText value="{0,date,MM'/'dd'/'yyyy}">
                        <apex:param value="{!Opportunity.Campaign_Start_Date__c}" /> 
                        </apex:outputText>
                    </td>
            </tr>
            
            <tr>
                <td align="left" style="color: #808080; border-right-style: solid; border-right-width: thin;
                    border-right-color: #30b55a;">
                    End Date
                </td>
                    <td style="font-weight: normal; padding-left: 5px;">
                        <apex:outputText value="{0,date,MM'/'dd'/'yyyy}">
                            <apex:param value="{!Opportunity.Campaign_End_Date__c}" /> 
                        </apex:outputText>
                    </td>
            </tr>
            
           
             <tr>
                <td align="left" style="color: #808080; border-right-style: solid; border-right-width: thin;
                    border-right-color: #30b55a;">
                    Duration 
                </td>
                    <td style="font-weight: normal; padding-left: 5px;">
                        <apex:outputText value="{0,number, }">
                            <apex:param value="{!Opportunity.Campaign_Duration__c}"/>
                        </apex:outputText> 
                    </td>
            </tr>
            <tr>
                <td align="left" style="color: #808080; border-right-style: solid; border-right-width: thin;
                    border-right-color: #30b55a;">
                    Geo
                </td>
                    <td style="font-weight: normal; padding-left: 5px;">
                        {!Opportunity.Targeting_Country__c} 
                    </td> 
            </tr>
            
             <tr>
                <td colspan="4">
                    &nbsp;
                </td>
            </tr>
            
        <tr>    
            <td colspan="4" style="font-weight: bold; border-bottom-style: solid; border-bottom-width: thick;
                border-bottom-color: #30b55a;">
                Mobile Spots -
                
                <apex:outputText value="{0,number,000,000}">
                    <apex:param value="{!Opportunity.Mobile_Spots_B__c}"/>
                </apex:outputText> 
            </td>
        </tr>
        <tr>
                <td align="left" style="color: #808080; border-right-style: solid; border-right-width: thin;
                    border-right-color: #30b55a;">
                    Audio Ads 
                </td>
                    <td style="font-weight: normal; padding-left: 5px;">
                        <apex:outputText value="{0, number, }">
                            <apex:param value="{!Opportunity.Mobile_Spots_B__c}"/>
                        </apex:outputText>
                    </td>
        </tr>
        <tr>
             <td width="160px" align="left" style="color: #808080; border-right-style: solid; border-right-width: thin;
                border-right-color: #30b55a;">
                Companion Banner
             </td>
                <td style="font-weight: normal; padding-left: 5px;">
                <apex:outputText value="{0, number, }">
                    <apex:param value="{!Opportunity.Mobile_Companion_Banner__c}"/>
                </apex:outputText>                    
                </td>
        </tr>
        <tr>
            <td align="left" style="color: #808080; border-right-style: solid; border-right-width: thin;
                border-right-color: #30b55a;">
                Display Impression
            </td>
            <td style="font-weight: normal; padding-left: 5px;">
                <apex:outputText value="{0, number, }">
                    <apex:param value="{!Opportunity.Mobile_Display_Impression__c}"/>
                </apex:outputText>
            </td>
        </tr>
        <tr>
            <td align="left" style="color: #808080; border-right-style: solid; border-right-width: thin;
                border-right-color: #30b55a;">
                Interstitial
            </td>
            <td style="font-weight: normal; padding-left: 5px;">
                <apex:outputText value="{0, number, }">
                    <apex:param value="{!Opportunity.Moblie_Interstitial__c}"/>
                </apex:outputText>
            </td>
        </tr>
        
        <tr>
            <td colspan = "4">
                &nbsp;
            </td>
        </tr>
        
        <tr style="display:{!IF(OR(Opportunity.Web_Spots_B__c == NULL, Opportunity.Web_Display_Impression__c == NULL, Opportunity.Web_Interstitial__c == NULL), 'none','block')}">
            <td colspan="4" style="font-weight: bold; border-bottom-style: solid; border-bottom-width: thick;
                border-bottom-color: #30b55a;">
                Web Spots -
                    <apex:outputText value="{0, number,}">
                    <apex:param value="{!Opportunity.Web_Spots_B__c}"/>
                    </apex:outputText>
            </td>
        </tr>
        

        <tr style="display:{!IF(OR(Opportunity.Web_Spots_B__c == NULL, Opportunity.Web_Display_Impression__c == NULL, Opportunity.Web_Interstitial__c == NULL), 'none','block')}">
            <td align="left" style="color: #808080; border-right-style: solid; border-right-width: thin;
                border-right-color: #30b55a;">
                Audio Ads 
            </td>
            <td style="font-weight: normal; padding-left: 5px;">
                <apex:outputText value="{0, number, }">
                    <apex:param value="{!Opportunity.Web_Spots_B__c}"/>
                </apex:outputText>
            </td>
        </tr>   
        
        
        
        <tr style="display:{!IF(OR(Opportunity.Web_Spots_B__c == NULL, Opportunity.Web_Display_Impression__c == NULL, Opportunity.Web_Interstitial__c == NULL), 'none','block')}">
            <td align="left" style="color: #808080; border-right-style: solid; border-right-width: thin;
                border-right-color: #30b55a;">
                Companion Banner
            </td>
            <td style="font-weight: normal; padding-left: 5px;">
                <apex:outputText value="{0, number, }">
                <apex:param value="{!Opportunity.Web_Spots_B__c}"/> 
                </apex:outputText>
            </td>
        </tr>   
       
        
        <tr style="display:{!IF(OR(Opportunity.Web_Spots_B__c == NULL, Opportunity.Web_Display_Impression__c == NULL, Opportunity.Web_Interstitial__c == NULL), 'none','block')}">
            <td align="left" style="color: #808080; border-right-style: solid; border-right-width: thin;
                border-right-color: #30b55a;">
                Display Impression
            </td>
            <td style="font-weight: normal; padding-left: 5px;">
                <apex:outputText value="{0, number,}">
                    <apex:param value="{!Opportunity.Web_Display_Impression__c}"/>
                </apex:outputText>
            </td>
      </tr> 
      
       <tr style="display:{!IF(OR(Opportunity.Web_Spots_B__c == NULL, Opportunity.Web_Display_Impression__c == NULL, Opportunity.Web_Interstitial__c == NULL), 'none','block')}">
            <td align="left" style="color: #808080; border-right-style: solid; border-right-width: thin;
                border-right-color: #30b55a;">
                Interstitial
            </td>
            <td style="font-weight: normal; padding-left: 5px;">
                <apex:outputText value="{0, number,}">
                    <apex:param value="{!Opportunity.Web_Interstitial__c}"/>
                </apex:outputText>
            </td>
        </tr> 
        
       
        <tr style="display:{!IF(OR(Opportunity.Web_Spots_B__c == NULL, Opportunity.Web_Display_Impression__c == NULL, Opportunity.Web_Interstitial__c == NULL), 'none','block')}">
            <td colspan="4">
                &nbsp;
            </td>
        </tr>
        
          <tr>
            <td colspan="4" style="font-weight: bold; border-bottom-style: solid; border-bottom-width: thick;
                border-bottom-color: #30b55a;">
                Total 
                </td> 
        </tr>
        <tr>
            <td align="left" style="color: #808080; border-right-style: solid; border-right-width: thin;
                border-right-color: #30b55a;">
                Spots
            </td>
            <td style="font-weight: normal; padding-left: 5px;">
                <apex:outputText value="{0, number,}">
                    <apex:param value="{!Opportunity.Total_Spot_Booked__c}"/>
                </apex:outputText>                
            </td>
        </tr>
        <tr>
            <td align="left" style="color: #808080; border-right-style: solid; border-right-width: thin;
                border-right-color: #30b55a;">
                Approx. Impressions 
            </td>
            <td style="font-weight: normal; padding-left: 5px;">
                <apex:OutputText value="{0, number, }">
                    <apex:param value="{!Opportunity.Total_Impressions__c}"/> 
                </apex:OutputText>                
            </td>
        </tr>
        <tr>
            <td colspan="4">
                &nbsp;
            </td>
        </tr>
        <tr>
            <td colspan="4" style="font-size: medium; font-weight: normal">
                Note: Spots will be spread out on the Mobile Playlist, Radio and ROS.        
            </td>
        </tr>
        
        <tr>
            <td colspan="4">
                &nbsp;
            </td>
        </tr>
        
        <tr>
            <td colspan="4" style="font-size: medium; font-weight: bold">
                <font color ="blue"> Deliverables from {!Opportunity.Account.Name} </font>
            </td>
        </tr>
        <tr>
            <td colspan="4" style="font-size: medium; font-weight: normal">
                <font color ="blue"> {!Opportunity.Campaign_Comments__c} </font>
            </td>
        </tr>
        
        <tr>
            <td colspan="4">
                &nbsp;
            </td>
        </tr>
        <tr>
            <td colspan="4">
                &nbsp;
            </td>
        </tr>
        
        <tr>
            <td colspan="4">
                &nbsp;
            </td>
        </tr>
        
         <tr>
            <td colspan="4" style="font-size: medium; font-weight: bold">
        Confidentiality:                 
            </td>
        </tr>
        
        <tr>
            <td colspan="4" style="font-size: medium; font-weight: normal">
        <p> The parties involved acknowledge and agree that this term sheet, its material terms and conditions and any other information 
            
        disclosed by one party to the other party in connection with this proposal or negotiation of the agreement is Confidential Information.</p>
        
         </td>
        </tr>
        
        <tr>
            <td colspan="4" style="font-size: medium; font-weight: bold">
        
        Above terms agreed to by:
            </td>
        </tr>

        <tr>
            <td colspan="4" style="font-size: medium; font-weight: normal">
        <br></br>
        Name:                           ____________________________________________________________________________________
        <br></br> Designation:                      ____________________________________________________________________________________

        <br></br> Company Name:             ____________________________________________________________________________________ 
        
        <br></br> Email Address:                ____________________________________________________________________________________ 
        
        <br></br> Mailing Address and Contact Details: ____________________________________________________________________________________ 
        
        <br></br> Signature:                            ____________________________________________________________________________________ 
        
        <br></br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            Date
        </td>
        </tr>
        <tr>
            <td colspan="4" style="font-size: medium; font-weight: bold">
        Above terms agreed to by (Name):
            </td>
        </tr>
        
        <tr>
            <td colspan="4" style="font-size: medium; font-weight: normal">
        <br></br> Name:                             ____________________________________________________________________________________ 
        
        <br></br> Designation:                      ____________________________________________________________________________________
        
        <br></br> Signature:                            ____________________________________________________________________________________
        <br></br>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            Date                                                                                                        
            </td>
        </tr>

 </body>
        </table>
        </center>
        </apex:pageBlock> 
        </apex:form>
        
    </html> 
</apex:page>

Thank You !
Lets assume that I created an object in DEV, several permissions respect to that object were set -not necessarily by me- and now this object is deployed to production. If I want to retrieve all the information like field permissions, accessibility ones, etc etc, I know that information will be in the profiles and in the permissionSets folder. What I don't know is all the xml element types used to specify this information. Does anyone know this? What could be the case for classes?
 
Hello, 

I'm pretty new with creating APEX triggers and with the help of other community developers here, was able to successfully create the APEX trigger below. 

My next challenge is to run this trigger when a user makes edits to the records these fields are associated with. 

My understanding is that an APEX class is needed to execute the APEX trigger, is this the case? If so, can someone help me in creating the APEX class to accomplish this? 

Here is my test class I created and is working fine and passed. Can we use this as the base to create my APEX Class to run my APEX trigger that is listed below this?

thanks!!!! 
 
public class TestCAPdataTiers {
    static testMethod void insertNewCAPdata() {
        Account acc = new account();
        acc.name = 'test';
        acc.Volume_Market__c = 'A';
        insert acc;
    
        CAPdata__c capdataToCreate = new CAPdata__c();
        
        capdataToCreate.Business_Review_Form_Owner__c = '005d0000000jQ8j';
        capdataToCreate.TierElitePreferredJobs__c = 36;
        capdataToCreate.Points__c = 100000;
        capdataToCreate.Account__c = acc.id;

        insert capdataToCreate;
        }
}


 
trigger CAPdataTiers on CAPdata__c (before insert,before update) {
    for (CAPdata__c CAP : Trigger.new) {
        if(CAP.Volume_Market__c.equalsIgnoreCase('A') && 
           CAP.Region_Program_Requirements__c != null && 
           CAP.Region_Program_Requirements__c.equalsIgnoreCase('Midwest'))
        {    //Midwest Market A
            CAP.TierElitePreferredJobs__c = 36; 
            CAP.TierElitePreferredRV__c = 90000;
            CAP.TierElitePreferredL6MosTA__c = 90;
            CAP.TierElitePreferredL6MosDA__c = 90;
            CAP.TierPreferredJobs__c = 24; 
            CAP.TierPreferredRV__c = 60000;
            CAP.TierPreferredL6MosTA__c = 75;
            CAP.TierRewardsAdvantageJobs__c = 12;
            CAP.TierRewardsAdvantageRV__c = 30000;
            CAP.TierRewardsAdvantageL6MosTA__c = 75;
        }
        else if(CAP.Volume_Market__c.equalsIgnoreCase('B') &&
           CAP.Region_Program_Requirements__c != null && 
           CAP.Region_Program_Requirements__c.equalsIgnoreCase('Midwest'))
        {    //Midwest Market B
            CAP.TierElitePreferredJobs__c = 18; 
            CAP.TierElitePreferredRV__c = 45000;
            CAP.TierElitePreferredL6MosTA__c = 90;
            CAP.TierElitePreferredL6MosDA__c = 90;
            CAP.TierPreferredJobs__c = 12; 
            CAP.TierPreferredRV__c = 30000;
            CAP.TierPreferredL6MosTA__c = 50;
            CAP.TierRewardsAdvantageJobs__c = 6;
            CAP.TierRewardsAdvantageRV__c = 15000;
            CAP.TierRewardsAdvantageL6MosTA__c = 25;
        }
        else if(CAP.Volume_Market__c.equalsIgnoreCase('A') &&
           CAP.Region_Program_Requirements__c != null && 
           CAP.Region_Program_Requirements__c.equalsIgnoreCase('Northeast'))
        {    //Northeast Market A
            CAP.TierElitePreferredJobs__c = 36; 
            CAP.TierElitePreferredRV__c = 90000;
            CAP.TierElitePreferredL6MosTA__c = 75;
            CAP.TierElitePreferredL6MosDA__c = 90;
            CAP.TierPreferredJobs__c = 24; 
            CAP.TierPreferredRV__c = 60000;
            CAP.TierPreferredL6MosTA__c = 50;
            CAP.TierRewardsAdvantageJobs__c = 12;
            CAP.TierRewardsAdvantageRV__c = 30000;
            CAP.TierRewardsAdvantageL6MosTA__c = 50;
        }
        else if(CAP.Volume_Market__c.equalsIgnoreCase('B') &&
           CAP.Region_Program_Requirements__c != null && 
           CAP.Region_Program_Requirements__c.equalsIgnoreCase('Northeast'))
        {    //Northeast Market B
            CAP.TierElitePreferredJobs__c = 18; 
            CAP.TierElitePreferredRV__c = 45000;
            CAP.TierElitePreferredL6MosTA__c = 75;
            CAP.TierElitePreferredL6MosDA__c = 90;
            CAP.TierPreferredJobs__c = 12; 
            CAP.TierPreferredRV__c = 30000;
            CAP.TierPreferredL6MosTA__c = 50;
            CAP.TierRewardsAdvantageJobs__c = 6;
            CAP.TierRewardsAdvantageRV__c = 15000;
            CAP.TierRewardsAdvantageL6MosTA__c = 25;
        }
        else if(CAP.Volume_Market__c.equalsIgnoreCase('A') &&
           CAP.Region_Program_Requirements__c != null && 
           CAP.Region_Program_Requirements__c.equalsIgnoreCase('Pacific Northwest'))
        {   //Pacific Northwest Market A
            CAP.TierElitePreferredJobs__c = 36; 
            CAP.TierElitePreferredRV__c = 90000;
            CAP.TierElitePreferredL6MosTA__c = 75;
            CAP.TierElitePreferredL6MosDA__c = 50;
            CAP.TierPreferredJobs__c = 24; 
            CAP.TierPreferredRV__c = 60000;
            CAP.TierPreferredL6MosTA__c = 50;
            CAP.TierRewardsAdvantageJobs__c = 12;
            CAP.TierRewardsAdvantageRV__c = 30000;
            CAP.TierRewardsAdvantageL6MosTA__c = 50;
        }
        else if(CAP.Volume_Market__c.equalsIgnoreCase('B') &&
           CAP.Region_Program_Requirements__c != null &&
           CAP.Region_Program_Requirements__c.equalsIgnoreCase('Pacific Northwest'))
        {    //Pacific Northwest Market B
            CAP.TierElitePreferredJobs__c = 18; 
            CAP.TierElitePreferredRV__c = 45000;
            CAP.TierElitePreferredL6MosTA__c = 75;
            CAP.TierElitePreferredL6MosDA__c = 50;
            CAP.TierPreferredJobs__c = 12; 
            CAP.TierPreferredRV__c = 30000;
            CAP.TierPreferredL6MosTA__c = 50;
            CAP.TierRewardsAdvantageJobs__c = 6;
            CAP.TierRewardsAdvantageRV__c = 15000;
            CAP.TierRewardsAdvantageL6MosTA__c = 50;
        }
        else if(CAP.Volume_Market__c.equalsIgnoreCase('A') && 
           CAP.Region_Program_Requirements__c != null &&
           CAP.Region_Program_Requirements__c.equalsIgnoreCase('South/West'))
        {   //South/West Market A
            CAP.TierElitePreferredJobs__c = 36; 
            CAP.TierElitePreferredRV__c = 90000;
            CAP.TierElitePreferredL6MosTA__c = 90;
            CAP.TierElitePreferredL6MosDA__c = 50;
            CAP.TierPreferredJobs__c = 24; 
            CAP.TierPreferredRV__c = 60000;
            CAP.TierPreferredL6MosTA__c = 75;
            CAP.TierRewardsAdvantageJobs__c = 12;
            CAP.TierRewardsAdvantageRV__c = 30000;
            CAP.TierRewardsAdvantageL6MosTA__c = 75;
        }
        else if(CAP.Volume_Market__c.equalsIgnoreCase('B') && 
           CAP.Region_Program_Requirements__c != null &&
           CAP.Region_Program_Requirements__c.equalsIgnoreCase('South/West'))
        {    //South/West Market B
            CAP.TierElitePreferredJobs__c = 18; 
            CAP.TierElitePreferredRV__c = 45000;
            CAP.TierElitePreferredL6MosTA__c = 90;
            CAP.TierElitePreferredL6MosDA__c = 50;
            CAP.TierPreferredJobs__c = 12; 
            CAP.TierPreferredRV__c = 30000;
            CAP.TierPreferredL6MosTA__c = 75;
            CAP.TierRewardsAdvantageJobs__c = 6;
            CAP.TierRewardsAdvantageRV__c = 15000;
            CAP.TierRewardsAdvantageL6MosTA__c = 75;
        }
    }
}

 
Hi...
I have a custom object called Contracts - on the account object, I have a lookup to the Contracts object. 
I would like to have a custom button on my custom Contracts object that will allow me to relate many accounts to this contract. 

Thoughts?
Hi,
I need to hyperlink a text field to my local drive on the server, so that it directs to the file.
I'm trying to create a VF page to launch a flow, but I can't get past this error after hitting the save button:
Error: <apex:component> is required and must be the outermost tag in the markup at line 1 column 1
Here is my VF page:
<apex:page standardController="Opportunity">
    <flow:interview name="New_Quote_Wizard" finishLocation="{!URLFOR('/a1m')}">
        <apex:param name="OppID2" value="{!Opportunity.Id}"/>
    </flow:interview>
</apex:page>

I'm following th example in the documentation, and this video: https://www.youtube.com/watch?v=FRdyCLJ-4l4 (timestamp: 28:11)
Hi,

I'm writing a button on a Case page that
1. gets some values from the local Case:
var name = "{!Case.Subject}";

2. Puts them into an Apex call to create a different object.
3. should write some stuff back into the local case, so
{!Case.Project__c} =  project;

...which does not work.

So what is the way to set the local record's fields in Javascript?

Thanks!

Cheers,
Thorsten

Hello,

I am trying to setup a custom button to open the current record (Case  object), but with a custom Layout (such as a printable summary).

I created the Layout (called "Case Layout - Support Report") and the button, but I do not understand how I can force the Layout.
Here is the code of the button (please indicate me a proper way, if possible, I do not like the hardcoded way:
https://eu4.salesforce.com/{!Case.Id}

Thanks for your help
I hit some combination of key strokes and did something to an Apex class. (I think I saw a message on the screen asking if I wanted to delete the file, but I'm not certain.) Now when I try to open it I get an error saying the file doesn't exist. But when I try to create an new version I can't, because I get a message saying it already exists. 

Repeat as necessary.

This file is part of a Trailhead tutorial, so it has to have a specific name or I can't evaluate my work, so have to use the name as assigned.

Ideas?
Hi all. A sandbox was created within my company before I started working here. The person who made it is no longer with the company. My boss refreshed the sandbox, so now I am able to login but it wants me to verify my identity. I'm not sure what email address the verification code is going to since I can't enter my real email address when logging into sandbox. Any suggestions on this? 
I am having trouble in the Salesforce module for creating global quick actions. I am not able to figure out what is wrong. How do I get help trying to solve this?
public with sharing class showallTimeCatdsCtrl {

public Invoice__c objInvoices {get;set;}

public Invoice__c obj  {get;set;}
public string recordTypeId {get;set;}
public string RecordTypename{get;set;}
public string  strProjectId{get;set;}
public date fromDate{get;set;}
public date toDate{get;set;}
public List<Timecard__c> lstTimeCards {get;set;}
public List<showallTimeCatdsCtrlwrapper> TcList = new List<showallTimeCatdsCtrlwrapper>();
public List<Timecard__c> selectedlstTimecards = new List<Timecard__c>();

 public showallTimeCatdsCtrl(ApexPages.StandardController controller) {
     objInvoices = new invoice__c ();
    obj = new invoice__c ();
    recordTypeId = ApexPages.currentPage().getParameters().get('RecordType');
    
    List<recordtype> lstRecordtypeName = [select id,name from recordtype where SobjectType ='invoice__c' and id=:recordTypeId limit 1 ];
    RecordTypename = lstRecordtypeName[0].name;   
    lstTimeCards  = new List<Timecard__c>();
        //obj=[select id,name,CurrencyIsoCode,recordtypeid from invoice__c where recordtypeid= :recordTypeId  limit 1];

    }
     
       public PageReference saveInvoices() {        
        strProjectId = objInvoices.Project__c;   
        objInvoices.recordtypeid = recordTypeId ;
        fromDate      =     objInvoices.Service_Term_From__c; 
        todate        =     objInvoices.Service_Term_To__c;
        
        upsert objInvoices;
        
        if(strProjectId!=null){
        
        lstTimeCards  =[select id, name ,project__c ,Employee__c, Date_Of_Service__c, Hours__c, invoiced__c, Client_Pay__c from Timecard__c where project__c  = :strProjectId and Date_Of_Service__c >= :fromDate  and Date_Of_Service__c  <= : todate];
         TcList.add(new showallTimeCatdsCtrlwrapper(Tc));
        return null;

          }  
       
        return null;
    }
    public PageReference getSelected()

    {

        selectedlstTimecards.clear();

        for(showallTimeCatdsCtrlwrapper Tcwrapper : TcList)

        if(Tcwrapper.selected == true)

        selectedlstTimecards.add(Tcwrapper.Tc);

        return null;

    }
        public PageReference Generate(){
        PageReference pageRef = new PageReference('/apex/editable');
        pageRef.setRedirect(false);
        return pageRef;
    }
    
    public class showallTimeCatdsCtrlwrapper

    {
        public Timecard__c Tc{get; set;}

        public Boolean selected {get; set;}

        public showallTimeCatdsCtrlwrapper(Timecard__c a)

        {

           Tc = a;

            selected = false;

        }

    }



}
i created a vf page for custom command button and add it on all layouts ,
but when i am accessing my org by salesforce1 app the button is not visible . please tell me what should i do ,....

Thanks in advance
i have the scenario that workflow has to trigger before 180 days of end date.
When i testing with providing all the criteria satisfied even then email in not triggering.
Please suggest me how to test it.
I’m trying to figure out how to retrieve Field Audit Trail metadata using the WorkBench, and I’m stumped. I used the WorkBench to deploy a zip file named package-Dev.zip, which contained the following files:

1) A file named Account.object: 
<?xml version="1.0" encoding="UTF-8"?>
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
   <historyRetentionPolicy>
       <archiveAfterMonths>14</archiveAfterMonths>
       <archiveRetentionYears>10</archiveRetentionYears>
       <description>Account object field history retention policy -- Dev</description>
       <gracePeriodDays>0</gracePeriodDays>
   </historyRetentionPolicy>
   <fields>
       <fullName>BillingAddress</fullName>
       <fullName>City_Mailing_Address_Group__c</fullName>
   </fields>
</CustomObject>
 
2) A file named package.xml: 
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>Account</members>
    </types>
    <version>32.0</version>
</Package>
 
Now I want to use the WorkBench to retrieve the metadata (history retention policy and fields) that I deployed for the account object via package-Dev.zip. What ‘s the XML code that I need to use to retrieve that metadata? I'm not an XML or API programmer, and all of the examples I've found seem to assume that I know more than I do, so I'm lost.
 
Thanks for your help!
 

Today we’re excited to announce the new Salesforce Developers Discussion Forums. We’ve listened to your feedback on how we can improve the forums.  With Chatter Answers, built on the Salesforce1 Platform, we were able to implement an entirely new experience, integrated with the rest of the Salesforce Developers site.  By the way, it’s also mobile-friendly.

We’ve migrated all the existing data, including user accounts. You can use the same Salesforce account you’ve always used to login right away.  You’ll also have a great new user profile page that will highlight your community activity.  Kudos have been replaced by “liking” a post instead and you’ll now be able to filter solved vs unsolved posts.

This is, of course, only the beginning  and because it’s built on the Salesforce1 Platform, we’re going to be able to bring you more features faster than ever before.  Be sure to share any feedback, ideas, or questions you have on this forum post.

Hats off to our development team who has been working tirelessly over the past few months to bring this new experience to our community. And thanks to each of you for helping to build one of the most vibrant and collaborative developer communities ever.