• Gregory512
  • NEWBIE
  • 0 Points
  • Member since 2009

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

I'm trying to send an automated email alert to a SF user using a VF email template.  I fear I may be trying to traverse too many objects to get the right data.  I'm trying to send related data from the Topic Content object to the User related to the Participant object.  This image will clear things up:

 

Image: https://docs.google.com/leaf?id=0ByK8RN289n76Mzc3N2FkYTQtOGNkMS00Yjc0LWE3OWItOGM5MWJjYWJmMGNk&sort=name&layout=list&num=50

 

For the recipient and relatedToType:

 

 

recipientType="User" relatedToType="Participant__c">

And to try and grab the Topic Content:

 

 

<apex:repeat var="tc" value="{!relatedTo.Class__c.Topic__c.Topic_Content__r}">

 I get this error message:

 

Error: Unknown property 'String.Topic__c'

 

 

I appreciate any help with this.. thanks in advance.

I'm new to apex... I'm trying to query the most three recent records based on a date field and then get the average.. I figure it would look something like this:

 

SELECT Amount__c FROM cObj__c ORDER BY Date__c ASC LIMIT 3

 
I'm not sure what happens next.  What I think I need to do is store each value in a separate variable or store the sum of the query result in a variable so I can get the average.

 

 

If I'm using the right approach here, I want to insert the final calculated value into a field, similar to the "Hello World" Apex example, except "World" is a dynamic value.

 

Thanks for your help, even if it is just to say this is the completely wrong way.

I'm attempting to use a rollup summary field to return the most recent value of a given field on a child object.  I also would like to add the three most recent values of a given field.

 

Have I run into a rollup summary field limitation or can this be done?  Or is there possibly a workaround?

 

Thanks for your help.

WIthout a significant background in programming, how realistic would it be to learn Apex and about how much time would I need to commit to prepare for the developer certification training (for a reasonably intelligent individual)?  Should I start with Java or can I jump right into Apex?

 

To give you an idea of my background, I've studied javascript and have made my way around basic php but nothing too daunting.

 

Thanks for any help.

I'm trying to make this validation rule apply only for users assigned to a custom profile called 'ICDS Standard User':

 

 

NOT(OR(ISNEW(),HasOpportunityLineItem))

 

 Any ideas on how to do this?

 

Thanks for your help. 

 

I'm pulling my hair out trying to understand what's wrong here.  I'll post the VF page and the controller below.  Here's the error message I'm getting when trying to save my page:

 

Error: Unknown property 'Austin_Workshops_Controller.ICDS.Name'

 

VF Page Code:

<apex:page tabStyle="SFDC_Class__c" controller="Austin_Workshops_Controller" sidebar="false" showHeader="false" cache="false"> <apex:form > <apex:pageBlock > <apex:pageBlockTable value="{!listClass}" var="c"> <apex:column > <apex:facet name="header"> Topic </apex:facet> <apex:outputText value="{!c.Topic}" /> </apex:column> <apex:column > <apex:facet name="header"> Instructor </apex:facet> <apex:outputText value="{!c.Instructor}" /> </apex:column> <apex:column > <apex:facet name="header"> Date </apex:facet> <apex:outputText value="{!c.ICDSDate}" /> <br /><apex:outputText value="{!c.Start}" /> - <apex:outputText value="{!c.EndTime}" /> </apex:column> <apex:column > <apex:facet name="header"> Hours </apex:facet> <apex:outputText value="{!c.Hours}" /> </apex:column> <apex:column > <apex:facet name="header"> Price </apex:facet> $<apex:outputText value="{!c.Price}" /> </apex:column> <apex:column > <apex:facet name="header"> Register </apex:facet> <a href="#" onclick="openLookup('https://www.paypal.com/cgi-bin/webscr?cmd=_cart&business=support%40cdstudies%2ecom&lc=US&item_name={!c.Name}&amount={!c.Workshop_Price__c}&currency_code=USD&button_subtype=products&cn=Add%20special%20instructions%20to%20the%20seller&no_shipping=2&shipping=0%2e00&add=1&bn=PP%2dShopCartBF%3abtn_cart_LG%2egif%3aNonHosted');" ><img src="https://www.paypal.com/en_US/i/btn/x-click-but10.gif" /></a> </apex:column> </apex:pageBlockTable> </apex:pageBlock> <script> var newWindow = null; function openLookup(myurl){ if(newWindow != null){ newWindow.close(); } newWindow=window.open(myurl, 'mywindow', 'resizable=yes,scrollbars=yes,status=yes,toolbar=false,height=700,width=810'); newWindow.creator=self; } </script> </apex:form> </apex:page>

 

And the Controller Code:

 

 

public without sharing class Austin_Workshops_Controller { // public properties public List<ICDS> listClass{ get; set; } // public construcotr public Austin_Workshops_Controller(){ try{ // Initialize public list of class listClass = new List<ICDS>(); ICDS icds = new ICDS(); Date dtToday = system.today(); // Fetch all classes records for(SFDC_Class__c c : [Select Id, Name, Contact__c,Contact__r.Name, Product2__c,Product2__r.Name, CEU_Hours__c, Workshop_Price__c, Workshop_Date__c, Start_Time__c, End_Time__c From SFDC_Class__c Where Product2__r.Name = 'Austin CEU Workshop' AND Workshop_Date__c >= : dtToday Order by Workshop_Date__c Limit 1000]){ icds = new ICDS(); icds.Id = c.Id; icds.Topic = c.Name; icds.Instructor = c.Contact__r.Name; icds.Hours = string.valueof(c.CEU_Hours__c); icds.Price = string.valueof(c.Workshop_Price__c); if(c.Workshop_Date__c != null){ Date dt = c.Workshop_Date__c; icds.ICDSDate = string.valueof(dt.month()) + '/' + string.valueof(dt.day()) + '/' + string.valueof(dt.year()); } icds.Start = string.valueof(c.Start_Time__c); icds.EndTime = string.valueof(c.End_Time__c); listClass.add(icds); } } catch(Exception ex){ system.debug(ex.getMessage()); } } public class ICDS{ public string Id { get; set; } public string Topic { get; set; } public string Instructor { get; set; } public string Hours { get; set; } public string Price { get; set; } public string ICDSDate { get; set; } public string Start { get; set; } public string EndTime { get; set; } } }

 

 

I appreciate any help.  Thanks.

Hi,

I'm trying to extend the filter criteria in this code to show only records whose date field (workshop_date__c) are either today or in the future.

Any ideas on how I edit this code to do that?

listClass = [Select Id, Name, Contact__c,Contact__r.Name, Product2__c,Product2__r.Name, Workshop_Date__c From SFDC_Class__c Where Product2__r.Name = 'Austin CEU Workshop' Limit 1000];

 


Just to be clear.. this is the code from a custom controller used for a visualforce page displayed publicly with sites.  

Thanks for helping out a newb.

Hi everyone,

 

I want to generate receipts from the opportunity object.  The way I think this should work is a custom button or link that links to a visualforce page.  On the VF page I want to list all products related to that opportunity. 

 

Here's some code that I think points me in the right direction, but I'm not sure exactly where to go next.  It's from the Force.com Cookbook.. directions how to show a table of contacts related to an account.  This is the controller code:

 

public class mySecondController { public Account getAccount() { return [select id, name, (select id, firstname, lastname from Contacts limit 5) from Account where id = :System.currentPageReference() .getParameters().get('id')]; } public String getName() { return 'My Second Custom Controller'; } }

 

And here's the sample VF page code to display the data:

 

 

<apex:page controller="mySecondController" tabStyle="Account"> <apex:pageBlock title="Hello {!$User.FirstName}!"> You belong to the {!account.name} account. </apex:pageBlock> <apex:pageBlock title="Contacts"> <apex:dataTable value="{!account.Contacts}" var="contact" cellPadding="4" border="1"> <apex:column > {!contact.FirstName} </apex:column> <apex:column > {!contact.LastName} </apex:column> </apex:dataTable> </apex:pageBlock> </apex:page>

Thanks for any help or suggestions.

I was wondering if someone could help a newb to SFDC come up with the code for an apex trigger.

 

Here's the scenario:

 

I have a custom object called payments (Payments__c) - a child object  of opportunities - and I would like a payment record to be created after a new opportunity record is created, but only if a checkbox is checked (Create_New_Payment__c).

 

There are a few fields on the new payment record that need to be pre-populated:

  1. The opportunity field (obviously)
  2. Payment amount (Amount__c) should equal the amount of the opportunity (the payment amount field is not a formula field and can't be, but maybe this can be accomplished with workflow - if Create_New_Payment__c is true, payment amount equals opportunity amount??)
  3. Paid__c checkbox equals true

So is this possible to do?

 

Thanks for any help.

I'm trying to create a GPA formula that looks like this:

 


(Phase_1_Grade_Points__c + Phase_2_Grade_Points__c +
Phase_3_Grade_Points__c + Phase_4_Grade_Points__c + Phase_5_Grade_Points__c +
Phase_6_Grade_Points__c + Practicum_Grade_Points__c ) / (Phase_1_Credits__c +
Phase_2_Credits__c + Phase_3_Credits__c + Phase_4_Credits__c +
Phase_5_Credits__c + Phase_6_Credits__c + Practicum_Credits__c)

 

 

I end up with an Error telling me the formula is too large.  Every value referenced in the above formula is similar to this:

 

CASE(Phase1_Grade__c , 'A', 12,'B',9,'C',6,'D',3,'F',0,0)

 

Is there any way to get around the error?

 

Thanks for your help.

I'm trying to send an automated email alert to a SF user using a VF email template.  I fear I may be trying to traverse too many objects to get the right data.  I'm trying to send related data from the Topic Content object to the User related to the Participant object.  This image will clear things up:

 

Image: https://docs.google.com/leaf?id=0ByK8RN289n76Mzc3N2FkYTQtOGNkMS00Yjc0LWE3OWItOGM5MWJjYWJmMGNk&sort=name&layout=list&num=50

 

For the recipient and relatedToType:

 

 

recipientType="User" relatedToType="Participant__c">

And to try and grab the Topic Content:

 

 

<apex:repeat var="tc" value="{!relatedTo.Class__c.Topic__c.Topic_Content__r}">

 I get this error message:

 

Error: Unknown property 'String.Topic__c'

 

 

I appreciate any help with this.. thanks in advance.

I'm new to apex... I'm trying to query the most three recent records based on a date field and then get the average.. I figure it would look something like this:

 

SELECT Amount__c FROM cObj__c ORDER BY Date__c ASC LIMIT 3

 
I'm not sure what happens next.  What I think I need to do is store each value in a separate variable or store the sum of the query result in a variable so I can get the average.

 

 

If I'm using the right approach here, I want to insert the final calculated value into a field, similar to the "Hello World" Apex example, except "World" is a dynamic value.

 

Thanks for your help, even if it is just to say this is the completely wrong way.

hi

 

I have this column set up as part of a related list, it all works fine but I want to use this column as an external link to a paypal cart. I am using a field "item.Paypal_button_text__c}" that replaces the v v long value in the original html so that I can refererence unique text foreach instance.  I get an errorwhen it redirects me.

 

 

 <apex:column headerValue="Availability" >
    <form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
        <input type="hidden" name="cmd" value="_s-xclick"></input>
        <apex:inputHidden id="encrypted" value="{!item.Paypal_button_text__c}"/>
        <input type="image" src="https://www.paypal.com/en_GB/i/btn/btn_cart_SM.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online."></input>
        <img alt="" border="0" src="https://www.paypal.com/en_GB/i/scr/pixel.gif" width="1" height="1"></img>
    </form>
</apex:column>   

 

It doesn't work,probably because I have thw HTML & Apex mixed up.

 

this is the original code from paypal

 

<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="encrypted" value="xxxxxxx-paypal v v long text !!!!, now in SF field">
<input type="image" src="https://www.paypal.com/en_GB/i/btn/btn_cart_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online.">
<img alt="" border="0" src="https://www.paypal.com/en_GB/i/scr/pixel.gif" width="1" height="1">
</form>

sorry about the format, but can you help

WIthout a significant background in programming, how realistic would it be to learn Apex and about how much time would I need to commit to prepare for the developer certification training (for a reasonably intelligent individual)?  Should I start with Java or can I jump right into Apex?

 

To give you an idea of my background, I've studied javascript and have made my way around basic php but nothing too daunting.

 

Thanks for any help.

I'm pulling my hair out trying to understand what's wrong here.  I'll post the VF page and the controller below.  Here's the error message I'm getting when trying to save my page:

 

Error: Unknown property 'Austin_Workshops_Controller.ICDS.Name'

 

VF Page Code:

<apex:page tabStyle="SFDC_Class__c" controller="Austin_Workshops_Controller" sidebar="false" showHeader="false" cache="false"> <apex:form > <apex:pageBlock > <apex:pageBlockTable value="{!listClass}" var="c"> <apex:column > <apex:facet name="header"> Topic </apex:facet> <apex:outputText value="{!c.Topic}" /> </apex:column> <apex:column > <apex:facet name="header"> Instructor </apex:facet> <apex:outputText value="{!c.Instructor}" /> </apex:column> <apex:column > <apex:facet name="header"> Date </apex:facet> <apex:outputText value="{!c.ICDSDate}" /> <br /><apex:outputText value="{!c.Start}" /> - <apex:outputText value="{!c.EndTime}" /> </apex:column> <apex:column > <apex:facet name="header"> Hours </apex:facet> <apex:outputText value="{!c.Hours}" /> </apex:column> <apex:column > <apex:facet name="header"> Price </apex:facet> $<apex:outputText value="{!c.Price}" /> </apex:column> <apex:column > <apex:facet name="header"> Register </apex:facet> <a href="#" onclick="openLookup('https://www.paypal.com/cgi-bin/webscr?cmd=_cart&business=support%40cdstudies%2ecom&lc=US&item_name={!c.Name}&amount={!c.Workshop_Price__c}&currency_code=USD&button_subtype=products&cn=Add%20special%20instructions%20to%20the%20seller&no_shipping=2&shipping=0%2e00&add=1&bn=PP%2dShopCartBF%3abtn_cart_LG%2egif%3aNonHosted');" ><img src="https://www.paypal.com/en_US/i/btn/x-click-but10.gif" /></a> </apex:column> </apex:pageBlockTable> </apex:pageBlock> <script> var newWindow = null; function openLookup(myurl){ if(newWindow != null){ newWindow.close(); } newWindow=window.open(myurl, 'mywindow', 'resizable=yes,scrollbars=yes,status=yes,toolbar=false,height=700,width=810'); newWindow.creator=self; } </script> </apex:form> </apex:page>

 

And the Controller Code:

 

 

public without sharing class Austin_Workshops_Controller { // public properties public List<ICDS> listClass{ get; set; } // public construcotr public Austin_Workshops_Controller(){ try{ // Initialize public list of class listClass = new List<ICDS>(); ICDS icds = new ICDS(); Date dtToday = system.today(); // Fetch all classes records for(SFDC_Class__c c : [Select Id, Name, Contact__c,Contact__r.Name, Product2__c,Product2__r.Name, CEU_Hours__c, Workshop_Price__c, Workshop_Date__c, Start_Time__c, End_Time__c From SFDC_Class__c Where Product2__r.Name = 'Austin CEU Workshop' AND Workshop_Date__c >= : dtToday Order by Workshop_Date__c Limit 1000]){ icds = new ICDS(); icds.Id = c.Id; icds.Topic = c.Name; icds.Instructor = c.Contact__r.Name; icds.Hours = string.valueof(c.CEU_Hours__c); icds.Price = string.valueof(c.Workshop_Price__c); if(c.Workshop_Date__c != null){ Date dt = c.Workshop_Date__c; icds.ICDSDate = string.valueof(dt.month()) + '/' + string.valueof(dt.day()) + '/' + string.valueof(dt.year()); } icds.Start = string.valueof(c.Start_Time__c); icds.EndTime = string.valueof(c.End_Time__c); listClass.add(icds); } } catch(Exception ex){ system.debug(ex.getMessage()); } } public class ICDS{ public string Id { get; set; } public string Topic { get; set; } public string Instructor { get; set; } public string Hours { get; set; } public string Price { get; set; } public string ICDSDate { get; set; } public string Start { get; set; } public string EndTime { get; set; } } }

 

 

I appreciate any help.  Thanks.

I'm new to visualforce and I've make a basic page to learn it.  I'm using standard controllers and no filters. My code below does exactly what I expect it to do, but when I publish the page to the public, 2 of my 4 test records are missing.  Can anyone tell me why?

 

<apex:page showHeader="false" sidebar="false"
standardController="Opportunity" recordSetVar="listings">
<h1>Land Search</h1>
<apex:dataTable value="{!listings}" var="pitem" rowClasses="odd,even">
<apex:column headerValue="Listings">
<apex:outputText value="{!pitem.name}"/>
</apex:column>
<apex:column headerValue="Acres">
<apex:outputText value="{!pitem.Acres__c}"/>
</apex:column>
<apex:column headerValue="List Price">
<apex:outputText value="{!pitem.List_Price__c}"/>
</apex:column>
<apex:column headerValue="Comments">
<apex:outputText value="{!pitem.Public_Marketing_Comments__c}"/>
</apex:column>
</apex:dataTable>
</apex:page>

 

 

 

 

Hi,

I'm trying to extend the filter criteria in this code to show only records whose date field (workshop_date__c) are either today or in the future.

Any ideas on how I edit this code to do that?

listClass = [Select Id, Name, Contact__c,Contact__r.Name, Product2__c,Product2__r.Name, Workshop_Date__c From SFDC_Class__c Where Product2__r.Name = 'Austin CEU Workshop' Limit 1000];

 


Just to be clear.. this is the code from a custom controller used for a visualforce page displayed publicly with sites.  

Thanks for helping out a newb.

Dear all,

 

I just create a new Force.com Site to handle registeration with Force.com Frree Edition. Strangely, this site may be viewed with https but need authentication with http:

 

http://free-12415f14c3a-124e539428a-125109c507b.force.com/

 


https://free-12415f14c3a-124e539428a-125109c507b.secure.force.com/

 

I made a copy of my environment in sandbox. The Site in sandbox has no problems at all. Both may be seen without any problems.

 

The start page is simple html text without any apex or controls. It shouldn't do anything with authentication.

 

I have check the profile, object, and data access setting but still have no idea at all. Is there any one could be me any suggestion to fix the issue?

 

Please help!

 

Best regards,

 

Amigo

Message Edited by Amigo on 01-12-2010 08:18 AM
  • January 12, 2010
  • Like
  • 0

Hi everyone,

 

I want to generate receipts from the opportunity object.  The way I think this should work is a custom button or link that links to a visualforce page.  On the VF page I want to list all products related to that opportunity. 

 

Here's some code that I think points me in the right direction, but I'm not sure exactly where to go next.  It's from the Force.com Cookbook.. directions how to show a table of contacts related to an account.  This is the controller code:

 

public class mySecondController { public Account getAccount() { return [select id, name, (select id, firstname, lastname from Contacts limit 5) from Account where id = :System.currentPageReference() .getParameters().get('id')]; } public String getName() { return 'My Second Custom Controller'; } }

 

And here's the sample VF page code to display the data:

 

 

<apex:page controller="mySecondController" tabStyle="Account"> <apex:pageBlock title="Hello {!$User.FirstName}!"> You belong to the {!account.name} account. </apex:pageBlock> <apex:pageBlock title="Contacts"> <apex:dataTable value="{!account.Contacts}" var="contact" cellPadding="4" border="1"> <apex:column > {!contact.FirstName} </apex:column> <apex:column > {!contact.LastName} </apex:column> </apex:dataTable> </apex:pageBlock> </apex:page>

Thanks for any help or suggestions.

Hello,

I am a new to force.com and I face a problem.

I have created 1 custom object Reservation with fields field1 and field2.

I want to add a validation rule that will check (at new object creation time) that another Reservation object does not already exist reservation with fields1that has the same vale as the object being created.

 

I have look at all the formula possibility and I don't see how to make a "find"  request on the existing objec.

 

Any idea

 

Thanks in advance for your help

  • October 27, 2009
  • Like
  • 0


We have created an application in salesforce.com.

 

Is there any way to access that application through some user(specified role), who

doesn't have an account in salesforce?.

 

If it is possible. pls help me.

Thanks in advance.

--KSR

  • October 26, 2009
  • Like
  • 0

L.S.

 

I am trying to copy an email address from one object to another related object.

 

if I select the "text" type in a formula field, it copies the email address allright. But then is is not recognised as an email adres and therefor can not be used for sending e-mails.

 

Any suggestions?

 

Any help is highly appreciated

 

Henk

 

 

  • October 24, 2009
  • Like
  • 0