• src0010
  • NEWBIE
  • 25 Points
  • Member since 2010

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 10
    Replies

Is there a way to export query results in the Force.com IDE Schema Explorer?  I often find it the fastest way to obtain a quick set of data and would like to be able to save the results directly from the IDE to a CSV file or something.

How do you install SalesForce releases once they become available (Ex:  Spring '10 Release)?  Also, is there a way to check your current production version?  Thanks! 

Currently I have a working page which lists items from one object.  I am trying to update this to group by two objects.  Details below:

 

 

Current APEX class code:

 

public class projectTracking
{
  private List<Project_Billing_Item__c> projects;
  public List<Project_Billing_Item__c> getProjects()

    {
      projects = [ SELECT Project__c, Name, Employee__c, Description_of_Work__c,   Hours_Worked__c, Date__c 
						FROM Project_Billing_Item__c 
							WHERE Employee__c = :Userinfo.getUserId()  
            ];
			
      return projects;
    }
}


Current VisualFoce code:

 

<apex:page controller="projectTracking" showHeader="true" renderAs="html">

<apex:sectionHeader title="My Projects" subtitle="{!$User.FirstName} {!$User.LastName}"/>
<p/>

<apex:form >
<apex:pageBlock title="List of current billing items" id="pageBlock">
<apex:pageMessages ></apex:pageMessages>
<apex:pageBlockTable value="{!projects}" var="proj" rendered="{!NOT(ISNULL(projects))}">
<apex:column value="{!proj.Project__c}"></apex:column>
<apex:column value="{!proj.Name}"></apex:column>
<apex:column value="{!proj.Description_of_Work__c}"></apex:column>
<apex:column value="{!proj.Hours_Worked__c}"></apex:column>
<apex:column value="{!proj.Date__c}"></apex:column>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>

</apex:page>

 

Produces the following rendered VisualForce page:

 

VisualForcePage

 

 

What I am trying to do now is group all the Project Billing Items by Project on the VisualForce page.  Currently I have updated the APEX class with the correct SOQL Query w/ Left Outer Join to group the results accordingly.  APEX class code below:

 

 

 

public class projectTracking
{
  private List<Project_Billing_Item__c> projects;
  public List<Project_Billing_Item__c> getProjects()

    {
      projects = [ SELECT Name, 
					(SELECT Project__c, Name, Employee__c, Description_of_Work__c, Hours_Worked__c, Date__c 
							FROM Project_Billing_Items__r 
									WHERE Employee__c = :Userinfo.getUserId()) 
					FROM Project__c
            ];
			
      return projects;
    }
}

 

I am not sure where to start with the VisualForce code though.  How do I update that to reference the List which is referencing two custom objects?   Thanks for the help and let me know if I can provide any additional information!

 

I am trying to create a query to group our Project Billing Item (custom object) by Project (another custom object).  Below is a copy of my initial query:

 

 

SELECT Name, (SELECT Project__c, Name, Employee__c, Description_of_Work__c, Hours_Worked__c, Date__c FROM Project_Billing_Item__c) FROM Project__c

Which generates the following error when executing: "Didn't understand relationship 'Project_Item__c' in FROM part of query call.  If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name."

 

 

I also tried changing it to the following:

 

 

SELECT Name, (SELECT Project__c, Name, Employee__c, Description_of_Work__c, Hours_Worked__c, Date__c FROM Project_Billing_Item__r) FROM Project__c

 

 

....and still receiving same error message stated above.  If it helps Project Billing Item (Project_Billing_Item__c) has a Master-Detail relationship to Project (Project__c).  Some additional information in case it helps:ks

 

 

Master-Detail Options
Related To: Project
Child Relationship Name: Project_Billing_Items
Related List Label: Project Billing Items

Master-Detail Options
Related To:   Project
Child Relationship Name:   Project_Billing_Items
Related List Label:    Project Billing Items

 

 

 

Thanks for the help and if I can provide any additional information that might help just let me know!

The following line:

 

 

Account: <apex:outputText value="{!X360_Contract_Cycle__c.Account__c}" />

 Produces the following on my VisualForce page (rendered as pdf):

 

 

Prepared for: 001Q0000008olvcIAA

 

I tried changing this to outputField instead of outputText (example below):

 

 

Account: <apex:outputField value="{!X360_Contract_Cycle__c.Account__c}" />

This displays the account name correctly (not the record ID).  That is good....except it included the account name as a selectable link on the rendered PDF.  What is the best way to output the value, not as the record ID, and not include the value as a link?  So far running into a little bit of a catch 22.  Thanks in advance for the help! 

 

Well, I was finally able to get one of my related lists (Cases), which is part of a custom object (X360_Contract_Cycle__c), to display properly.  I am using apex:repeat to iterate and display the related list information.  So far that is working great!  Now I am trying to figure out the best solution to SUM on of the values within the related list/apex:repeat.  The value I am trying to SUM is {!cx.Case_Hours__c}.  I included a snippet of the code below.  I am wondering if I can include the logic directly on the VisualForce page or would I need to create a custom Apex class?  Any suggestions would be much appreciated as I am still learning.  Thanks! 

 

 

<apex:page standardController="X360_Contract_Cycle__c"    showHeader="false"  renderAs="pdf">
.
.
.
                
                <tr>
                    <td>Case Number</td>
                    <td>Case Subject</td>
                    <td>Case Hours</td>
                </tr>
                
                <apex:repeat var="cx" value="{!X360_Contract_Cycle__c.Cases__r}">

                    <tr>
                        <td>{!cx.CaseNumber}</td>
                        <td>{!cx.Subject}</td>
                        <td>{!cx.Case_Hours__c}</td>
                        
                        <apex:variable var="Total" value="{SUM(!cx.Case_Hours__c}"/>
                        
                        <td>{!Total}</td>
                        
                    </tr>
                
                 </apex:repeat>
 
</apex:page>

 

 

Just curious (being new to VisualForce dev), but can anyone explain to me the difference between:

apex:pageBlock
and

 

 

apex:repeat

 

Both seem to iterate over data in the same method?  Thanks in advance!

Hi,
 
I am working on a Visualforce email template that pulls data from a custom object and renders to PDF.  I was able to get everything working and the regular 'outputField' data appears on the rendered PDF without any issues.  However, I am trying to get related lists on the custom object to display on the PDF and not having any success so far.   
 
 Below is a copy of my Visualforce email template (related list I am trying to call is highlighted in red):

<messaging:emailTemplate subject="Your requested quote #{!relatedTo.Name}" recipientType="Contact" relatedToType="X360_Contract_Cycle__c"> <messaging:plainTextEmailBody > Dear {!recipient.name}, Thank you for your continued interest in our offering. Please see the attached quote per your request. Feel free to contact me if you have any questions. Regards, {!$User.firstname} {!$User.lastname} </messaging:plainTextEmailBody> <messaging:attachment renderAs="pdf" filename="{!relatedTo.name}"> <apex:panelGrid columns="1" styleClass="companyTable" width="100%"> <apex:outputText value="{!$Organization.Name}" styleClass="companyName"/> <apex:outputText value="{!$Organization.Street}"/> <apex:outputText value="{!$Organization.City}, {!$Organization.State} {!$Organization.PostalCode}"/> <apex:outputText value="{!$Organization.Phone}"/> </apex:panelGrid> <apex:panelGrid columns="1" styleClass="centered" width="100%"> <apex:outputText value="Quote# {!relatedTo.Name}" /> Start Date: <apex:outputField value="{!relatedTo.Start_Date__c}" /> End Date: <apex:outputField value="{!relatedTo.End_Date__c}" /> Contracted Development Service Hours: <apex:outputField value="{!relatedTo.Contracted_Development_Service_Hours__c}" /> Delivered Development Service Hours: <apex:outputField value="{!relatedTo.Delivered_Hours__c}" /> . . . <apex:relatedList list="Cases__r"/> </apex:panelGrid> </messaging:attachment></messaging:emailTemplate>

 

WSDL for the 'X360_Contract_Cycle__c' custom object I am calling is below (the related list element in question is highlighted in red...note this is a lookup relation from Case to X360_Contract_Cycle__c) :

 

 

<complexType name="X360_Contract_Cycle__c"> <complexContent> <extension base="ens:sObject"> <sequence> <element name="Account__c" nillable="true" minOccurs="0" type="tns:ID"/> <element name="Account__r" nillable="true" minOccurs="0" type="ens:Account"/> <element name="ActivityHistories" nillable="true" minOccurs="0" type="tns:QueryResult"/> <element name="Attachments" nillable="true" minOccurs="0" type="tns:QueryResult"/> <element name="Cases__r" nillable="true" minOccurs="0" type="tns:QueryResult"/> <element name="Contracted_Audits__c" nillable="true" minOccurs="0" type="xsd:double"/> <element name="Contracted_Development_Service_Hours__c" nillable="true" minOccurs="0" type="xsd:double"/> <element name="Contracted_Oxygen_Licenses__c" nillable="true" minOccurs="0" type="xsd:double"/> <element name="Contracted_Training_Seats__c" nillable="true" minOccurs="0" type="xsd:double"/> <element name="CreatedBy" nillable="true" minOccurs="0" type="ens:User"/> <element name="CreatedById" nillable="true" minOccurs="0" type="tns:ID"/> <element name="CreatedDate" nillable="true" minOccurs="0" type="xsd:dateTime"/> <element name="Delivered_Audits__c" nillable="true" minOccurs="0" type="xsd:double"/> <element name="Delivered_Hours__c" nillable="true" minOccurs="0" type="xsd:double"/> <element name="Delivered_Oxygen_Licenses__c" nillable="true" minOccurs="0" type="xsd:double"/> <element name="End_Date__c" nillable="true" minOccurs="0" type="xsd:date"/> <element name="Events" nillable="true" minOccurs="0" type="tns:QueryResult"/> <element name="Histories" nillable="true" minOccurs="0" type="tns:QueryResult"/> <element name="IsDeleted" nillable="true" minOccurs="0" type="xsd:boolean"/> <element name="LastActivityDate" nillable="true" minOccurs="0" type="xsd:date"/> <element name="LastModifiedBy" nillable="true" minOccurs="0" type="ens:User"/> <element name="LastModifiedById" nillable="true" minOccurs="0" type="tns:ID"/> <element name="LastModifiedDate" nillable="true" minOccurs="0" type="xsd:dateTime"/> <element name="Name" nillable="true" minOccurs="0" type="xsd:string"/> <element name="Notes" nillable="true" minOccurs="0" type="tns:QueryResult"/> <element name="NotesAndAttachments" nillable="true" minOccurs="0" type="tns:QueryResult"/> <element name="OpenActivities" nillable="true" minOccurs="0" type="tns:QueryResult"/> <element name="Owner" nillable="true" minOccurs="0" type="ens:Name"/> <element name="OwnerId" nillable="true" minOccurs="0" type="tns:ID"/> <element name="Oxygen_License_Request__r" nillable="true" minOccurs="0" type="tns:QueryResult"/> <element name="ProcessInstances" nillable="true" minOccurs="0" type="tns:QueryResult"/> <element name="ProcessSteps" nillable="true" minOccurs="0" type="tns:QueryResult"/> <element name="Site_Audit__r" nillable="true" minOccurs="0" type="tns:QueryResult"/> <element name="Start_Date__c" nillable="true" minOccurs="0" type="xsd:date"/> <element name="SystemModstamp" nillable="true" minOccurs="0" type="xsd:dateTime"/> <element name="Tasks" nillable="true" minOccurs="0" type="tns:QueryResult"/> <element name="Training_Attended__c" nillable="true" minOccurs="0" type="xsd:double"/> <element name="Training_Attendee__r" nillable="true" minOccurs="0" type="tns:QueryResult"/> </sequence> </extension> </complexContent> </complexType>

 

 

 

 Any suggestions on what I am doing wrong?  Thanks!

Is there a way to export query results in the Force.com IDE Schema Explorer?  I often find it the fastest way to obtain a quick set of data and would like to be able to save the results directly from the IDE to a CSV file or something.

How do you install SalesForce releases once they become available (Ex:  Spring '10 Release)?  Also, is there a way to check your current production version?  Thanks! 

I am trying to create a query to group our Project Billing Item (custom object) by Project (another custom object).  Below is a copy of my initial query:

 

 

SELECT Name, (SELECT Project__c, Name, Employee__c, Description_of_Work__c, Hours_Worked__c, Date__c FROM Project_Billing_Item__c) FROM Project__c

Which generates the following error when executing: "Didn't understand relationship 'Project_Item__c' in FROM part of query call.  If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name."

 

 

I also tried changing it to the following:

 

 

SELECT Name, (SELECT Project__c, Name, Employee__c, Description_of_Work__c, Hours_Worked__c, Date__c FROM Project_Billing_Item__r) FROM Project__c

 

 

....and still receiving same error message stated above.  If it helps Project Billing Item (Project_Billing_Item__c) has a Master-Detail relationship to Project (Project__c).  Some additional information in case it helps:ks

 

 

Master-Detail Options
Related To: Project
Child Relationship Name: Project_Billing_Items
Related List Label: Project Billing Items

Master-Detail Options
Related To:   Project
Child Relationship Name:   Project_Billing_Items
Related List Label:    Project Billing Items

 

 

 

Thanks for the help and if I can provide any additional information that might help just let me know!

The following line:

 

 

Account: <apex:outputText value="{!X360_Contract_Cycle__c.Account__c}" />

 Produces the following on my VisualForce page (rendered as pdf):

 

 

Prepared for: 001Q0000008olvcIAA

 

I tried changing this to outputField instead of outputText (example below):

 

 

Account: <apex:outputField value="{!X360_Contract_Cycle__c.Account__c}" />

This displays the account name correctly (not the record ID).  That is good....except it included the account name as a selectable link on the rendered PDF.  What is the best way to output the value, not as the record ID, and not include the value as a link?  So far running into a little bit of a catch 22.  Thanks in advance for the help! 

 

Well, I was finally able to get one of my related lists (Cases), which is part of a custom object (X360_Contract_Cycle__c), to display properly.  I am using apex:repeat to iterate and display the related list information.  So far that is working great!  Now I am trying to figure out the best solution to SUM on of the values within the related list/apex:repeat.  The value I am trying to SUM is {!cx.Case_Hours__c}.  I included a snippet of the code below.  I am wondering if I can include the logic directly on the VisualForce page or would I need to create a custom Apex class?  Any suggestions would be much appreciated as I am still learning.  Thanks! 

 

 

<apex:page standardController="X360_Contract_Cycle__c"    showHeader="false"  renderAs="pdf">
.
.
.
                
                <tr>
                    <td>Case Number</td>
                    <td>Case Subject</td>
                    <td>Case Hours</td>
                </tr>
                
                <apex:repeat var="cx" value="{!X360_Contract_Cycle__c.Cases__r}">

                    <tr>
                        <td>{!cx.CaseNumber}</td>
                        <td>{!cx.Subject}</td>
                        <td>{!cx.Case_Hours__c}</td>
                        
                        <apex:variable var="Total" value="{SUM(!cx.Case_Hours__c}"/>
                        
                        <td>{!Total}</td>
                        
                    </tr>
                
                 </apex:repeat>
 
</apex:page>

 

 

Just curious (being new to VisualForce dev), but can anyone explain to me the difference between:

apex:pageBlock
and

 

 

apex:repeat

 

Both seem to iterate over data in the same method?  Thanks in advance!

I'm still new to visualforce and apex but I'm trying to figure out how to calculate the sum of fields in an visualforce email template.

 

I am making a receipt that can be emailed and I want to sum the total of payments made. I'm using an app called pervasive integrated credit card processor. The payments object's parent is Accounts. The visual force template is under Opportunities. 

 

It would be nice if I could do a simple roll-up summary field on the opportunity to sum the payments and then pull the amount but since payments is a child of accounts it does not allow me to do this. 

 

So, saying all that I just need to sum the payments where the opportunity ID is the ID of the current opportunity being used. 

 

How would I code this? Is there an easier way?

Hi,
 
I am working on a Visualforce email template that pulls data from a custom object and renders to PDF.  I was able to get everything working and the regular 'outputField' data appears on the rendered PDF without any issues.  However, I am trying to get related lists on the custom object to display on the PDF and not having any success so far.   
 
 Below is a copy of my Visualforce email template (related list I am trying to call is highlighted in red):

<messaging:emailTemplate subject="Your requested quote #{!relatedTo.Name}" recipientType="Contact" relatedToType="X360_Contract_Cycle__c"> <messaging:plainTextEmailBody > Dear {!recipient.name}, Thank you for your continued interest in our offering. Please see the attached quote per your request. Feel free to contact me if you have any questions. Regards, {!$User.firstname} {!$User.lastname} </messaging:plainTextEmailBody> <messaging:attachment renderAs="pdf" filename="{!relatedTo.name}"> <apex:panelGrid columns="1" styleClass="companyTable" width="100%"> <apex:outputText value="{!$Organization.Name}" styleClass="companyName"/> <apex:outputText value="{!$Organization.Street}"/> <apex:outputText value="{!$Organization.City}, {!$Organization.State} {!$Organization.PostalCode}"/> <apex:outputText value="{!$Organization.Phone}"/> </apex:panelGrid> <apex:panelGrid columns="1" styleClass="centered" width="100%"> <apex:outputText value="Quote# {!relatedTo.Name}" /> Start Date: <apex:outputField value="{!relatedTo.Start_Date__c}" /> End Date: <apex:outputField value="{!relatedTo.End_Date__c}" /> Contracted Development Service Hours: <apex:outputField value="{!relatedTo.Contracted_Development_Service_Hours__c}" /> Delivered Development Service Hours: <apex:outputField value="{!relatedTo.Delivered_Hours__c}" /> . . . <apex:relatedList list="Cases__r"/> </apex:panelGrid> </messaging:attachment></messaging:emailTemplate>

 

WSDL for the 'X360_Contract_Cycle__c' custom object I am calling is below (the related list element in question is highlighted in red...note this is a lookup relation from Case to X360_Contract_Cycle__c) :

 

 

<complexType name="X360_Contract_Cycle__c"> <complexContent> <extension base="ens:sObject"> <sequence> <element name="Account__c" nillable="true" minOccurs="0" type="tns:ID"/> <element name="Account__r" nillable="true" minOccurs="0" type="ens:Account"/> <element name="ActivityHistories" nillable="true" minOccurs="0" type="tns:QueryResult"/> <element name="Attachments" nillable="true" minOccurs="0" type="tns:QueryResult"/> <element name="Cases__r" nillable="true" minOccurs="0" type="tns:QueryResult"/> <element name="Contracted_Audits__c" nillable="true" minOccurs="0" type="xsd:double"/> <element name="Contracted_Development_Service_Hours__c" nillable="true" minOccurs="0" type="xsd:double"/> <element name="Contracted_Oxygen_Licenses__c" nillable="true" minOccurs="0" type="xsd:double"/> <element name="Contracted_Training_Seats__c" nillable="true" minOccurs="0" type="xsd:double"/> <element name="CreatedBy" nillable="true" minOccurs="0" type="ens:User"/> <element name="CreatedById" nillable="true" minOccurs="0" type="tns:ID"/> <element name="CreatedDate" nillable="true" minOccurs="0" type="xsd:dateTime"/> <element name="Delivered_Audits__c" nillable="true" minOccurs="0" type="xsd:double"/> <element name="Delivered_Hours__c" nillable="true" minOccurs="0" type="xsd:double"/> <element name="Delivered_Oxygen_Licenses__c" nillable="true" minOccurs="0" type="xsd:double"/> <element name="End_Date__c" nillable="true" minOccurs="0" type="xsd:date"/> <element name="Events" nillable="true" minOccurs="0" type="tns:QueryResult"/> <element name="Histories" nillable="true" minOccurs="0" type="tns:QueryResult"/> <element name="IsDeleted" nillable="true" minOccurs="0" type="xsd:boolean"/> <element name="LastActivityDate" nillable="true" minOccurs="0" type="xsd:date"/> <element name="LastModifiedBy" nillable="true" minOccurs="0" type="ens:User"/> <element name="LastModifiedById" nillable="true" minOccurs="0" type="tns:ID"/> <element name="LastModifiedDate" nillable="true" minOccurs="0" type="xsd:dateTime"/> <element name="Name" nillable="true" minOccurs="0" type="xsd:string"/> <element name="Notes" nillable="true" minOccurs="0" type="tns:QueryResult"/> <element name="NotesAndAttachments" nillable="true" minOccurs="0" type="tns:QueryResult"/> <element name="OpenActivities" nillable="true" minOccurs="0" type="tns:QueryResult"/> <element name="Owner" nillable="true" minOccurs="0" type="ens:Name"/> <element name="OwnerId" nillable="true" minOccurs="0" type="tns:ID"/> <element name="Oxygen_License_Request__r" nillable="true" minOccurs="0" type="tns:QueryResult"/> <element name="ProcessInstances" nillable="true" minOccurs="0" type="tns:QueryResult"/> <element name="ProcessSteps" nillable="true" minOccurs="0" type="tns:QueryResult"/> <element name="Site_Audit__r" nillable="true" minOccurs="0" type="tns:QueryResult"/> <element name="Start_Date__c" nillable="true" minOccurs="0" type="xsd:date"/> <element name="SystemModstamp" nillable="true" minOccurs="0" type="xsd:dateTime"/> <element name="Tasks" nillable="true" minOccurs="0" type="tns:QueryResult"/> <element name="Training_Attended__c" nillable="true" minOccurs="0" type="xsd:double"/> <element name="Training_Attendee__r" nillable="true" minOccurs="0" type="tns:QueryResult"/> </sequence> </extension> </complexContent> </complexType>

 

 

 

 Any suggestions on what I am doing wrong?  Thanks!