• Charles McDowell
  • NEWBIE
  • 10 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 20
    Questions
  • 17
    Replies
I can not get jQuery to work.  So I set this test to redirect a page. It does not work.  Can someone identify the problem

<apex:page >
    <!--  TestJava.vfp -->

     <apex:includeScript value="{! $Resource.jQuery }"/>

    <script >
    var returnURL='/apex/Recommendation_Request_Dataview';
        function redirectPage(){
              $(location).attr('href', '{$Page.Recommendation_Request_Dataview}');
        }
    </script>

    
    <apex:form >
    
        <apex:commandButton value="Move" onclick="redirectPage" />

    </apex:form>
</apex:page>
Using a standard controller I am trying to use jQuery to redirect my page.  It does not work.  I am new to jQuery, can someone identify the problem


<apex:page standardController="Request_Chemical__c" sidebar="false" >
    <apex:includeScript value="$Resources.jQuery" />
    
    <script >
    var returnURL='/apex/Recommendation_Request_Dataview';
        function redirectPage(){
              $(location).attr('href' returnURL);
        }
    </script>
    
    <apex:form >
        <apex:pageBlock title="Chemical Exposure" >
           <apex:pageBlockSection >
            <apex:inputField value="{!Request_Chemical__c.Recommendation_Request__c}" /><br/>
            <apex:inputField value="{!Request_Chemical__c.Chemical__c}" /><br/>
            <apex:inputField value="{!Request_Chemical__c.Percentage__c}" />
        </apex:pageBlockSection>
        
            <apex:pageBlockButtons >
                <apex:commandButton action="{!Save}" oncomplete="redirectPage" value="Save" />
               <apex:commandButton action="{!Cancel}" value="Back" /> 
         </apex:pageBlockButtons>

        </apex:pageBlock>
 
    </apex:form>
  
</apex:page>
I need to use javascript.  What javascript file do I need and where can can I get it.  Thanks
I am trying to get the value of the parent Record to redirect my child record back to the parent.   Parent is Quote__c and Child is QuoteDetail__c. I get a null for qID.  Can someone tell me what I am doing wrong?


<apex:page standardController="QuoteDetail__c" extensions="QuoteDetailRecExtension" sidebar="False" >{
    <apex:form >
        <apex:pageBlock >
            <apex:pageBlockSection columns="1">
                <apex:outputField value="{!QuoteDetail__c.Product__c}" />
                <apex:outputField value="{!QuoteDetail__c.Product_Category__c}" />
                <apex:outputField value="{!QuoteDetail__c.Order_In_System__c}" />
                <apex:outputField value="{!QuoteDetail__c.Quantity__c}"  />
                <apex:outputField value="{!QuoteDetail__c.Coverage_Density__c}" />
                <apex:outputField value="{!QuoteDetail__c.Product_Total__c}" />
                <apex:outputField value="{!QuoteDetail__c.Quote__c}" id="Quote"/>
                <apex:outputField value="{!QuoteDetail__c.ID}" rendered="false" />
            
            </apex:pageBlockSection>
            
            <apex:pageBlockSection >
                <apex:pageBlockTable value="{!qp}" var="q" >
                    <apex:column headerValue="Product/Size" value="{!q.ProductSizePrice__c}" />
                    <apex:column value="{!q.Quantity__c}" />
                    <apex:column value="{!q.List_Price__c}" />
                    <apex:column value="{!q.Ext__c}" />
                
                </apex:pageBlockTable>
            
            
            </apex:pageBlockSection>
        
            <apex:pageBlockButtons location="Bottom">
                <apex:commandButton value="Edit" action="{!Edit}"/ >
                <apex:commandButton value="Back" action="{!Back}" >
                        <apex:param name="Quote" value="{!QuoteDetail__c.Quote__c}" />
                </apex:commandButton>
            </apex:pageBlockButtons>

        </apex:pageBlock>
    
    </apex:form>
</apex:page>

public class QuoteDetailRecExtension {
    Public List<QuotePrice__c> qp {Get;Set;}
                               
    
    Public QuoteDetailRecExtension(Apexpages.StandardController cext) {
       String ID = apexpages.currentPage().getParameters().get('id');
        qp = [Select ProductSizePrice__c, Quantity__c, List_Price__c, Ext__c 
              From QuotePrice__c Where QuoteDetail__c = : Id];
    }
   

    Public pagereference back(){
       // Get the ParentID - QuoteID
        String qID = apexpages.currentPage().getparameters().get('Quote');
        
        system.debug('Quote ID = ' + qID);
        pagereference ret = page.QuoteDetail;
        ret.getParameters().put('ID', qID);
        ret.setRedirect(True);
        
        return ret;
    }
   
}
 
I am trying to send an email but it does not send. I test delivery that does not work. One I use the following code,  the log says that there is 1 email invocation but no email is sent.  Is there something that I have to set in order to send email.

<apex:page controller="RequestEmailController">
    <apex:form >
        <apex:pageBlock title="Email">
            <b>Enter Subject  </b>    <apex:inputText value="{!Subject}" maxlength="100" /><p/> <br/>
            <apex:outputLabel for="bod" value="Enter Body"> </apex:outputLabel>
            <apex:inputTextarea value="{!Body}" id="bod" rows="8" cols="60" /><p/>

             <apex:pageBlockButtons > 
             <apex:commandButton value="Send Request" action="{!Send}"  />
            </apex:pageBlockButtons>   

        </apex:pageBlock>
    </apex:form>
</apex:page>

public class RequestEmailController {
    Public String subject {Get;Set;}
    Public String body {Get;Set;}
    List<String> eaddr = new List<String>{'c.mcdowell@sbcglobal.net'};
    
    Public PageReference send(){
        
        messaging.singleEmailmessage email = new messaging.singleEmailmessage();
            email.setSubject(Subject);
            email.setPlainTextBody(Body);
            email.setToAddresses(eaddr);
        
            Messaging.sendEmailResult[] r = messaging.sendEmail(new messaging.SingleEmailMessage[] {email});
        System.debug('The email size is: ' + r.size());
        Return null;
    }

}
 
I am trying to nest tables for three level. Quote - Products - Product Price by Size.  I get the Quote and Products but the Price is not nested. Is it possible to do this?

<apex:page standardController="Project__c" extensions="ProjectRptExtension" >
    <apex:form >
        <b>{!Project__c.Name}
              <apex:pageBlock >
                  <apex:pageBlockTable value="{!q}" var="g">
                    <apex:column value="{!g.name}" />
                    
                    <apex:column breakBefore="true" colspan="2" >
                            <apex:pageBlockSection Title = "Products" columns="1">
                            <apex:pageBlockTable value="{!qd}" var = "d">
                                <apex:column value="{!d.name}" />
                              </apex:pageBlockTable>     
                           </apex:pageBlockSection>
                        </apex:column >
                            
                    <apex:column breakBefore="True" colspan="2" >
                                <apex:pageBlockSection title="Pricing" columns="1">
                                    <apex:pageBlockTable value="{!qp}" var = "p">
                                        <apex:column value="{!p.ProductSizePrice__c}" />
                                     </apex:pageBlockTable>
                            </apex:pageBlockSection>    
                    </apex:column > 
                
                </apex:pageBlockTable>            
                
                    
                
           </apex:pageBlock>

        
        
        </b>
    
    </apex:form>
    
</apex:page>​
I have have four objects 1:Project__c   2:Child - Quote__c   3: Child: QuoteDetail__c  4:Child: QuotePrice__c
here is my code. I get an error the q.ID is not recognized.  Can someone tell what I am doing wrong? Thanks
here is my code

public class ProjectRptExtension {
    Public List<Quote__c> q {get;set;}
    Public List<QuoteDetail__c> qd {get;set;}
    Public List<QuotePrice__c> qp {get;set;}
    
    Public ProjectRptExtension(apexPages.StandardController controller){
        Set<ID> setQDid = new Set<ID>();
       
        ID MyId = apexpages.currentPage().getParameters().get('id');
      // Project__c  = (Project__c)controller.getRecord();

        
        q   = [Select ID, Name, System__c, Coverage_Area__c, System_Price__c, Project__c From 
            Quote__c Where  Project__c = : MyID limit 1];     
        
        
        qd = [Select  Name, Product__c, Product_Category__c, Order_In_System__c, Product_Total__c,
                 Coverage_Density__c, Quantity__c From QuoteDetail__c  
              Where Quote__c = : q.Id];
        
        For (QuoteDetail__c qdt: qd){
            setQDid.add(qdt.id);
        }
            
        
        qp = [Select ProductSizePrice__c, Quantity__c, List_Price__c, Ext__c 
              From QuotePrice__c Where QuoteDetail__c in : setQDid];
    }
}







 

I have the following extension class. From the debug I know that the id is valid.  But I don't get the record. Help!

public class ProjDetailExtension {
    Public List<Quote__c> quote {Get;Set;}
    
    Public ProjDetailExtension(Apexpages.StandardController ctrl){
        If(apexpages.currentPage().getParameters().containsKey('id')){
            quote = new  List<Quote__c>();
            
            String myID = apexpages.currentPage().getParameters().get('id');
            
            Quote = [Select Name, System__c, Coverage_Area__c, System_Price__c, Project__c From 
              Quote__c Where Project__c = : myID ];     
            }
            
          }  
      
    Public pageReference GetQuote(){
        ID id;
        id = apexPages.currentPage().getParameters().get('qID');
        System.debug('The ID is ' +id);
        pageReference ref = Page.QuoteDetail;
        ref.getParameters().get(id);
        ref.setRedirect(True);
        return ref;    
         
    }
    
    markup
<apex:page standardController="Project__c" extensions="ProjDetailExtension" >
 
    <apex:form >
        <apex:pageBlock title="Project Record " id="proj">
            <apex:pageblocksection columns="2">
                <apex:outputField value="{!Project__c.Account__c}"/>
                <apex:outputField value="{!Project__c.Contact__c}"/> 
                 <apex:outputField value="{!Project__c.Name}"/>
                <apex:outputField value="{!Project__c.Description__c}"/>
                <apex:outputField value="{!Project__c.City__c}"/>
                <apex:outputField value="{!Project__c.Date__c}"/>
                <apex:outputField value="{!Project__c.Status__c}"/>
                <apex:outputField value="{!Project__c.State__c}"/>  
                <apex:outputField value="{!Project__c.Zip__c}"/>
                <apex:outputField value="{!Project__c.Country__c}"/>
                <apex:outputField value="{!Project__c.Requested_By__c}"/>
                <apex:outputField value="{!Project__c.Effective_Date__c}"/>
                <apex:outputField value="{!Project__c.End_Date__c}"/>
                <apex:outputField value="{!Project__c.Created_By__c}"/> 
                <apex:outputField value="{!Project__c.Project_Total__c}"/> 
           
            </apex:pageblocksection>

            <apex:pageBlockSection columns="1">
                <b>This is the Quote Section</b>
                <apex:pageBlockTable value="{!Quote}" var="q" >
                    <apex:column >
                   <apex:commandLink value="{!q.name}" action="{!GetQuote}"  >
                        <apex:param name="qID" value="{!q.id}" />
                    </apex:commandLink>
                    </apex:column>
                    
                    <apex:column value="{!q.System__c}" />
                    <apex:column value="{!q.Coverage_Area__c}" />
                    <apex:column value="{!q.System_Price__c}" />
                    
                </apex:pageBlockTable>
            
            </apex:pageBlockSection>
    
            <apex:pageBlockButtons >
                <apex:commandButton value="Back" action="{!List}"  />    
                <apex:commandButton value="Edit" action="{!Edit}"  /> 
                <apex:commandButton value="New Quote" action="{!NewQuote}"  />
                 <apex:commandButton value="Cancel" action="{!Cancel}"  />
            </apex:pageBlockButtons>
        </apex:pageBlock>
      
      </apex:form>
             
</apex:page>
 

I am new to Salesforce.  I have a list of a custom object (Proje using StandardSetController.  I want a  button to navigate to the next page. I am getting the "Unknown constructor 'ProjectExtensionController.ProjectExtensionController(ApexPages.StandardController controller)'  Thanks in advance for your help

My Extension Class
public class ProjectExtensionController {

    
    Public ProjectExtensionController(Apexpages.StandardSetController Controller) {
           

    }
  
     Public PageReference EditRec(){
        ID id = System.currentPageReference().getparameters().get('ProjectID');
        PageReference ProjectDetail = Page.ProjectDetail;
        ProjectDetail.setRedirect(True);
        ProjectDetail.getParameters().get('id');
        return ProjectDetail;
    }
 }
_____________________Markup

<apex:page standardController ="Project__c" recordSetVar="Proj" extensions="ProjectExtensionController"  >
       <apex:form >
        <apex:pageBlock >
            <apex:pageBlockTable title="Project Datasheet" value="{!Proj}" var="p" >
                <apex:column >
                    <apex:commandLink value="{!p.name}" action="{!EditRec}">      
                        <apex:param Name="ProjectID" value="{!p.ID}" />
                    </apex:commandLink>
                </apex:column>
                
                   <apex:column value="{!p.Account__c}" /> 
                <apex:column value="{!p.Date__c}" />
                <apex:column value="{!p.Description__c}" />
                <apex:column value="{!p.Status__c}" />
                <apex:column value="{!p.City__c}" />
                <apex:column value="{!p.Project_Total__c}" />
       
            </apex:pageBlockTable>
            <!--{!$CurrentPage.parameters.ProjectID} -->
               
        <apex:pageBlockButtons >
             <apex:commandButton value="Cancel" action="{!Cancel}"  />
        </apex:pageBlockButtons>
    </apex:pageBlock>
    </apex:form>
  </apex:page>
I am new to Salesforce. I am trying to get detail to show when I click the link. I check to see if parameters are passed and  no values are updated can someone tell me what is wrong.  thanks

<apex:page standardController="Account" recordSetVar="acts" sidebar="False" >
   <apex:form >
        <apex:pageBlock title="Accounts" > 
            <apex:pageBlockSection >
                <apex:pageBlockTable value="{!acts}" var="a">
                    <apex:column >
                        <apex:commandLink value="{!a.name}"  reRender="relView"/>
                        <apex:param name="AccountID" value="{!a.ID}"/>
                        <apex:param name="Name" value="{!a.Name}"/>
                    </apex:column>
                    <apex:column value="{!a.ID}" />
                    <apex:column value="{!a.Industry}" />
                </apex:pageBlockTable>
                
       
    
                <apex:pageBlock title="Account Detail" ID="relView">
                    {!$CurrentPage.parameters.AccountID}<br/>
                   {!$CurrentPage.parameters.Name}
                </apex:pageBlock>
                     
            </apex:pageBlockSection>
           </apex:pageBlock> 
       
    </apex:form> 
</apex:page>
I have a developer acct and I have my first client which has a nonprofit edition. The client has provided my email access.  But when I log into salesforce I am in my developer org.  Do I have to set up another account in order to log into my Clients Org
I am new to salesforce and I wrote a class and I keep getting the error:  Expecting a semi-colon found <eof>. Can anyone tell me what the problem is.

public class FileSetup {
   static List<Category__c> cat = new List<Category__c>();
      
    Public FileSetup(){
       cat =  [Select ID, Category__c from category__c];
    }
   static void runSetup(){
       FileSetup obj = new FileSetup() ;
       for(Category__c c : filesetup.cat){
            system.debug(c.id);  
       }
   }
}
 Is there a way to turn it on? There is a Lighning App Builder that creats a lighning page. Can anyone tell me what is going on?
 I have an issue. the select statement returns no rows. If I put  in the Query Editor it works fine.   Help!!!

@isTest
Static void UpdateInvoice_Test(){

    Try  {
           Usage__c u = [Select BillingDate__c, InternetUsage__c, MobileUsage__c From Usage__c Where Id = 'a0B1500000tQ8beEAC']; 

            u.BillingDate__c = date.today();
               u.InternetUsage__c = 300;
               u.MobileUsage__c = 300;
            
        update u;
    }
public class RetrievePrice {
   Public Static Map<String , Double>  UtilPrice(){
      List<Utility_Price__c> upp =[Select Price_Type__c, Price__c From Utility_Price__c ];
          Map<String, Double> pMap = new Map<String, Double>();         
    {    
    for (Utility_Price__c p :upp){
            pmap.put(p.price_type__c, p.Price__c);
            system.debug('The price is:' + p.Price__c);        
    }
            Return pmap; 
  
    }
}
}

public class createInvoice{
    static Map<String, Double> Price = new Map<String, Double>();
        createInvoice(){
        Price = RetrievePrice.UtilPrice();
}
}
How do I reference the values in the map
<apex:page standardController="Account">
    <apex:pageBlock >
        <apex:form >
            <apex:pageBlockSection >
            <apex:pageBlockSection columns="1">
                <apex:commandButton action="{! Save}" value="Save"/>
                <apex:inputField value="{! Account.Name}"/>
                <apex:inputText id="cFirstName" label="FirstName" />
                <apex:inputText id="cLastName" label="LastName" />
                <apex:inputField value="{! Account.BillingStreet}"/>
                <apex:inputField value="{! Account.BillingCity}"/>
                <apex:inputField value="{! Account.BillingState}"/>
                <apex:inputField value="{! Account.Phone}"/>
                <apex:inputField value="{! Account.BillingStreet}"/>
                </apex:pageBlockSection>
            </apex:pageBlockSection>
            
            <apex:pageBlock title="Contacts">
                <apex:pageBlockSection >
                    <apex:pageBlockSection columns="2">
 
                    </apex:pageBlockSection>
                </apex:pageBlockSection>
            </apex:pageBlock>
           
        </apex:form>
    
    </apex:pageBlock>
</apex:page>
trigger AddRelatedCustomer on Account (after insert) {
I am new to salesforce and I am gett the no viable alternative at character '"' from this trigger.  Can you tell me what I am doing wrong

List<Contact> cont = new List<Contact>();
    for(Account acct: Trigger.new)
    {
           cont.add(New Contact(LastName = "Stitt",FirstName = "Sonny", AccountID = acct.ID));
        insert cont;
        
    }
}
I have completed most of the beginner devloper trail and I want to began to setup an org for my company and begin to import data. Can I set up another org.
Challege: When the Account Shipping Street Changes - Update Address in Contact mailing addess File.

This is the Error Msg: Challenge Not yet complete... here's what's wrong: An update to an account record failed to update the mailing address fields of all child contact records. Make sure that the process is correct and that it is activated.

Screen Shoots


User-added image
User-added image
Thanks
Chuck
In the Trail Object Exercise the API trail__c  but when I use that name, I get the following error:
Error: The Object Name field can only contain underscores and alphanumeric characters. It must be unique, begin with a letter, not include spaces, not end with an underscore, and not contain two consecutive underscores.
I am trying to nest tables for three level. Quote - Products - Product Price by Size.  I get the Quote and Products but the Price is not nested. Is it possible to do this?

<apex:page standardController="Project__c" extensions="ProjectRptExtension" >
    <apex:form >
        <b>{!Project__c.Name}
              <apex:pageBlock >
                  <apex:pageBlockTable value="{!q}" var="g">
                    <apex:column value="{!g.name}" />
                    
                    <apex:column breakBefore="true" colspan="2" >
                            <apex:pageBlockSection Title = "Products" columns="1">
                            <apex:pageBlockTable value="{!qd}" var = "d">
                                <apex:column value="{!d.name}" />
                              </apex:pageBlockTable>     
                           </apex:pageBlockSection>
                        </apex:column >
                            
                    <apex:column breakBefore="True" colspan="2" >
                                <apex:pageBlockSection title="Pricing" columns="1">
                                    <apex:pageBlockTable value="{!qp}" var = "p">
                                        <apex:column value="{!p.ProductSizePrice__c}" />
                                     </apex:pageBlockTable>
                            </apex:pageBlockSection>    
                    </apex:column > 
                
                </apex:pageBlockTable>            
                
                    
                
           </apex:pageBlock>

        
        
        </b>
    
    </apex:form>
    
</apex:page>​
Using a standard controller I am trying to use jQuery to redirect my page.  It does not work.  I am new to jQuery, can someone identify the problem


<apex:page standardController="Request_Chemical__c" sidebar="false" >
    <apex:includeScript value="$Resources.jQuery" />
    
    <script >
    var returnURL='/apex/Recommendation_Request_Dataview';
        function redirectPage(){
              $(location).attr('href' returnURL);
        }
    </script>
    
    <apex:form >
        <apex:pageBlock title="Chemical Exposure" >
           <apex:pageBlockSection >
            <apex:inputField value="{!Request_Chemical__c.Recommendation_Request__c}" /><br/>
            <apex:inputField value="{!Request_Chemical__c.Chemical__c}" /><br/>
            <apex:inputField value="{!Request_Chemical__c.Percentage__c}" />
        </apex:pageBlockSection>
        
            <apex:pageBlockButtons >
                <apex:commandButton action="{!Save}" oncomplete="redirectPage" value="Save" />
               <apex:commandButton action="{!Cancel}" value="Back" /> 
         </apex:pageBlockButtons>

        </apex:pageBlock>
 
    </apex:form>
  
</apex:page>
I am trying to get the value of the parent Record to redirect my child record back to the parent.   Parent is Quote__c and Child is QuoteDetail__c. I get a null for qID.  Can someone tell me what I am doing wrong?


<apex:page standardController="QuoteDetail__c" extensions="QuoteDetailRecExtension" sidebar="False" >{
    <apex:form >
        <apex:pageBlock >
            <apex:pageBlockSection columns="1">
                <apex:outputField value="{!QuoteDetail__c.Product__c}" />
                <apex:outputField value="{!QuoteDetail__c.Product_Category__c}" />
                <apex:outputField value="{!QuoteDetail__c.Order_In_System__c}" />
                <apex:outputField value="{!QuoteDetail__c.Quantity__c}"  />
                <apex:outputField value="{!QuoteDetail__c.Coverage_Density__c}" />
                <apex:outputField value="{!QuoteDetail__c.Product_Total__c}" />
                <apex:outputField value="{!QuoteDetail__c.Quote__c}" id="Quote"/>
                <apex:outputField value="{!QuoteDetail__c.ID}" rendered="false" />
            
            </apex:pageBlockSection>
            
            <apex:pageBlockSection >
                <apex:pageBlockTable value="{!qp}" var="q" >
                    <apex:column headerValue="Product/Size" value="{!q.ProductSizePrice__c}" />
                    <apex:column value="{!q.Quantity__c}" />
                    <apex:column value="{!q.List_Price__c}" />
                    <apex:column value="{!q.Ext__c}" />
                
                </apex:pageBlockTable>
            
            
            </apex:pageBlockSection>
        
            <apex:pageBlockButtons location="Bottom">
                <apex:commandButton value="Edit" action="{!Edit}"/ >
                <apex:commandButton value="Back" action="{!Back}" >
                        <apex:param name="Quote" value="{!QuoteDetail__c.Quote__c}" />
                </apex:commandButton>
            </apex:pageBlockButtons>

        </apex:pageBlock>
    
    </apex:form>
</apex:page>

public class QuoteDetailRecExtension {
    Public List<QuotePrice__c> qp {Get;Set;}
                               
    
    Public QuoteDetailRecExtension(Apexpages.StandardController cext) {
       String ID = apexpages.currentPage().getParameters().get('id');
        qp = [Select ProductSizePrice__c, Quantity__c, List_Price__c, Ext__c 
              From QuotePrice__c Where QuoteDetail__c = : Id];
    }
   

    Public pagereference back(){
       // Get the ParentID - QuoteID
        String qID = apexpages.currentPage().getparameters().get('Quote');
        
        system.debug('Quote ID = ' + qID);
        pagereference ret = page.QuoteDetail;
        ret.getParameters().put('ID', qID);
        ret.setRedirect(True);
        
        return ret;
    }
   
}
 
I am trying to send an email but it does not send. I test delivery that does not work. One I use the following code,  the log says that there is 1 email invocation but no email is sent.  Is there something that I have to set in order to send email.

<apex:page controller="RequestEmailController">
    <apex:form >
        <apex:pageBlock title="Email">
            <b>Enter Subject  </b>    <apex:inputText value="{!Subject}" maxlength="100" /><p/> <br/>
            <apex:outputLabel for="bod" value="Enter Body"> </apex:outputLabel>
            <apex:inputTextarea value="{!Body}" id="bod" rows="8" cols="60" /><p/>

             <apex:pageBlockButtons > 
             <apex:commandButton value="Send Request" action="{!Send}"  />
            </apex:pageBlockButtons>   

        </apex:pageBlock>
    </apex:form>
</apex:page>

public class RequestEmailController {
    Public String subject {Get;Set;}
    Public String body {Get;Set;}
    List<String> eaddr = new List<String>{'c.mcdowell@sbcglobal.net'};
    
    Public PageReference send(){
        
        messaging.singleEmailmessage email = new messaging.singleEmailmessage();
            email.setSubject(Subject);
            email.setPlainTextBody(Body);
            email.setToAddresses(eaddr);
        
            Messaging.sendEmailResult[] r = messaging.sendEmail(new messaging.SingleEmailMessage[] {email});
        System.debug('The email size is: ' + r.size());
        Return null;
    }

}
 
I have have four objects 1:Project__c   2:Child - Quote__c   3: Child: QuoteDetail__c  4:Child: QuotePrice__c
here is my code. I get an error the q.ID is not recognized.  Can someone tell what I am doing wrong? Thanks
here is my code

public class ProjectRptExtension {
    Public List<Quote__c> q {get;set;}
    Public List<QuoteDetail__c> qd {get;set;}
    Public List<QuotePrice__c> qp {get;set;}
    
    Public ProjectRptExtension(apexPages.StandardController controller){
        Set<ID> setQDid = new Set<ID>();
       
        ID MyId = apexpages.currentPage().getParameters().get('id');
      // Project__c  = (Project__c)controller.getRecord();

        
        q   = [Select ID, Name, System__c, Coverage_Area__c, System_Price__c, Project__c From 
            Quote__c Where  Project__c = : MyID limit 1];     
        
        
        qd = [Select  Name, Product__c, Product_Category__c, Order_In_System__c, Product_Total__c,
                 Coverage_Density__c, Quantity__c From QuoteDetail__c  
              Where Quote__c = : q.Id];
        
        For (QuoteDetail__c qdt: qd){
            setQDid.add(qdt.id);
        }
            
        
        qp = [Select ProductSizePrice__c, Quantity__c, List_Price__c, Ext__c 
              From QuotePrice__c Where QuoteDetail__c in : setQDid];
    }
}







 

I have the following extension class. From the debug I know that the id is valid.  But I don't get the record. Help!

public class ProjDetailExtension {
    Public List<Quote__c> quote {Get;Set;}
    
    Public ProjDetailExtension(Apexpages.StandardController ctrl){
        If(apexpages.currentPage().getParameters().containsKey('id')){
            quote = new  List<Quote__c>();
            
            String myID = apexpages.currentPage().getParameters().get('id');
            
            Quote = [Select Name, System__c, Coverage_Area__c, System_Price__c, Project__c From 
              Quote__c Where Project__c = : myID ];     
            }
            
          }  
      
    Public pageReference GetQuote(){
        ID id;
        id = apexPages.currentPage().getParameters().get('qID');
        System.debug('The ID is ' +id);
        pageReference ref = Page.QuoteDetail;
        ref.getParameters().get(id);
        ref.setRedirect(True);
        return ref;    
         
    }
    
    markup
<apex:page standardController="Project__c" extensions="ProjDetailExtension" >
 
    <apex:form >
        <apex:pageBlock title="Project Record " id="proj">
            <apex:pageblocksection columns="2">
                <apex:outputField value="{!Project__c.Account__c}"/>
                <apex:outputField value="{!Project__c.Contact__c}"/> 
                 <apex:outputField value="{!Project__c.Name}"/>
                <apex:outputField value="{!Project__c.Description__c}"/>
                <apex:outputField value="{!Project__c.City__c}"/>
                <apex:outputField value="{!Project__c.Date__c}"/>
                <apex:outputField value="{!Project__c.Status__c}"/>
                <apex:outputField value="{!Project__c.State__c}"/>  
                <apex:outputField value="{!Project__c.Zip__c}"/>
                <apex:outputField value="{!Project__c.Country__c}"/>
                <apex:outputField value="{!Project__c.Requested_By__c}"/>
                <apex:outputField value="{!Project__c.Effective_Date__c}"/>
                <apex:outputField value="{!Project__c.End_Date__c}"/>
                <apex:outputField value="{!Project__c.Created_By__c}"/> 
                <apex:outputField value="{!Project__c.Project_Total__c}"/> 
           
            </apex:pageblocksection>

            <apex:pageBlockSection columns="1">
                <b>This is the Quote Section</b>
                <apex:pageBlockTable value="{!Quote}" var="q" >
                    <apex:column >
                   <apex:commandLink value="{!q.name}" action="{!GetQuote}"  >
                        <apex:param name="qID" value="{!q.id}" />
                    </apex:commandLink>
                    </apex:column>
                    
                    <apex:column value="{!q.System__c}" />
                    <apex:column value="{!q.Coverage_Area__c}" />
                    <apex:column value="{!q.System_Price__c}" />
                    
                </apex:pageBlockTable>
            
            </apex:pageBlockSection>
    
            <apex:pageBlockButtons >
                <apex:commandButton value="Back" action="{!List}"  />    
                <apex:commandButton value="Edit" action="{!Edit}"  /> 
                <apex:commandButton value="New Quote" action="{!NewQuote}"  />
                 <apex:commandButton value="Cancel" action="{!Cancel}"  />
            </apex:pageBlockButtons>
        </apex:pageBlock>
      
      </apex:form>
             
</apex:page>
 

I am new to Salesforce.  I have a list of a custom object (Proje using StandardSetController.  I want a  button to navigate to the next page. I am getting the "Unknown constructor 'ProjectExtensionController.ProjectExtensionController(ApexPages.StandardController controller)'  Thanks in advance for your help

My Extension Class
public class ProjectExtensionController {

    
    Public ProjectExtensionController(Apexpages.StandardSetController Controller) {
           

    }
  
     Public PageReference EditRec(){
        ID id = System.currentPageReference().getparameters().get('ProjectID');
        PageReference ProjectDetail = Page.ProjectDetail;
        ProjectDetail.setRedirect(True);
        ProjectDetail.getParameters().get('id');
        return ProjectDetail;
    }
 }
_____________________Markup

<apex:page standardController ="Project__c" recordSetVar="Proj" extensions="ProjectExtensionController"  >
       <apex:form >
        <apex:pageBlock >
            <apex:pageBlockTable title="Project Datasheet" value="{!Proj}" var="p" >
                <apex:column >
                    <apex:commandLink value="{!p.name}" action="{!EditRec}">      
                        <apex:param Name="ProjectID" value="{!p.ID}" />
                    </apex:commandLink>
                </apex:column>
                
                   <apex:column value="{!p.Account__c}" /> 
                <apex:column value="{!p.Date__c}" />
                <apex:column value="{!p.Description__c}" />
                <apex:column value="{!p.Status__c}" />
                <apex:column value="{!p.City__c}" />
                <apex:column value="{!p.Project_Total__c}" />
       
            </apex:pageBlockTable>
            <!--{!$CurrentPage.parameters.ProjectID} -->
               
        <apex:pageBlockButtons >
             <apex:commandButton value="Cancel" action="{!Cancel}"  />
        </apex:pageBlockButtons>
    </apex:pageBlock>
    </apex:form>
  </apex:page>
I am new to Salesforce. I am trying to get detail to show when I click the link. I check to see if parameters are passed and  no values are updated can someone tell me what is wrong.  thanks

<apex:page standardController="Account" recordSetVar="acts" sidebar="False" >
   <apex:form >
        <apex:pageBlock title="Accounts" > 
            <apex:pageBlockSection >
                <apex:pageBlockTable value="{!acts}" var="a">
                    <apex:column >
                        <apex:commandLink value="{!a.name}"  reRender="relView"/>
                        <apex:param name="AccountID" value="{!a.ID}"/>
                        <apex:param name="Name" value="{!a.Name}"/>
                    </apex:column>
                    <apex:column value="{!a.ID}" />
                    <apex:column value="{!a.Industry}" />
                </apex:pageBlockTable>
                
       
    
                <apex:pageBlock title="Account Detail" ID="relView">
                    {!$CurrentPage.parameters.AccountID}<br/>
                   {!$CurrentPage.parameters.Name}
                </apex:pageBlock>
                     
            </apex:pageBlockSection>
           </apex:pageBlock> 
       
    </apex:form> 
</apex:page>
I am new to salesforce and I wrote a class and I keep getting the error:  Expecting a semi-colon found <eof>. Can anyone tell me what the problem is.

public class FileSetup {
   static List<Category__c> cat = new List<Category__c>();
      
    Public FileSetup(){
       cat =  [Select ID, Category__c from category__c];
    }
   static void runSetup(){
       FileSetup obj = new FileSetup() ;
       for(Category__c c : filesetup.cat){
            system.debug(c.id);  
       }
   }
}
trigger AddRelatedCustomer on Account (after insert) {
I am new to salesforce and I am gett the no viable alternative at character '"' from this trigger.  Can you tell me what I am doing wrong

List<Contact> cont = new List<Contact>();
    for(Account acct: Trigger.new)
    {
           cont.add(New Contact(LastName = "Stitt",FirstName = "Sonny", AccountID = acct.ID));
        insert cont;
        
    }
}
Hi,

I am new to SF and am trying out its features. 

I created a new User and did not receive login details via email. I tried resetting the password and also testing deliverability.
No emails being sent out at all.

And yes, the deliverabiltiy settings are set to 'All emails', so that is not the issue.

Can anyone help with this?

 
Challege: When the Account Shipping Street Changes - Update Address in Contact mailing addess File.

This is the Error Msg: Challenge Not yet complete... here's what's wrong: An update to an account record failed to update the mailing address fields of all child contact records. Make sure that the process is correct and that it is activated.

Screen Shoots


User-added image
User-added image
Thanks
Chuck

Hi

 

LIST <contact> c=[select lastname,firstname,account.name,account.industry from contact where title='New Software'];
system.debug(c.account.name);
system.debug(c.account.industry);
system.debug('the lastname is '+c.lastname);

 

 

Initial term of field expression must be a concrete SObject: LIST?Means

 

 

Thanks Ramesh

  • November 21, 2013
  • Like
  • 2