• Lindsay Rose
  • NEWBIE
  • 50 Points
  • Member since 2011

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 7
    Replies

I am trying to write a simple Apex class to send out an email to one of our administrators with a list of the "Peer To Peer" objects that have not been fully approved. I am planning on scheduling this class to run by implementing the Schedulable interface. My problem is that I am not able to get the methods of the SingleEmailMessage class to accept any parameters! The PeerToPeerHoldReportBuilder class simply provides the content for the email, so I am pretty sure the problem resides in the code below where I am actually creating the email:

 

Also, when I say that the method won't accept parameters, I mean that I cannot save my class if I call .setToAddresses(toAddresses), or .setHtmlBody(body), or .setSubject(subject). This is mind boggling for me! The error I am receiving states" Unexpected character, expected ')' "

 

public with sharing class PeerToPeerHoldReportBuilder
{
PeerToPeerHoldReporter reporter = new PeerToPeerHoldReporter();
Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();
String subject = 'Peer to Peer Report';
String body = reporter.ParseValues();
String[] toAddresses = new String[] {'lryan@enterasys.com'};

email.setToAddresses(toAddresses);
email.setHtmlBody(body);

email.setSubject(subject);
List<Messaging.SendEmailResult> result = Messaging.sendEmail(new Messaging.Email[] { email } ,false);

}

 

 

 

Any help would be appreciated, this is the third time I have picked this task back up and each time I cannot continue working with it because the issues with the email classes methods not accepting parameters.

 

Any ideas would be greatly appreciated! 


Is there a way to apply custom styling to multi select picklists on a visualforce page? I have a visualforce page with about 12 multiselect picklists, and as items are selected and deselected the width of each picklist changes.

I would like to find a way to force all of the picklists on my page to a specific consistent width. I want the left and right picklists to be the same width regardless of their contents. I have not been able to get this working using the style tag, it simple spreads the lists apart and adds unnecessary space around the arrows.

I have been experiencing difficulty using an inputfield to capture a date value on a visualforce page. The code code I am using is: 

 

        <apex:pageBlockSectionItem >

<apex:outputLabel >When is the new account required by? </apex:outputLabel>

</apex:pageBlockSectionItem>

 

        <apex:pageBlockSectionItem >

        <apex:inputField required="true" value="{!NewForm.Date_Needed__c}"/>

        </apex:pageBlockSectionItem>                 

 

 

these pageBlockSectionItems are properly nested inside a pageblocksection, and a page block. The page is not throwing any errors, but the value is not being captured.

 

What is interesting is I am using the same code in a different component for another form and it is working just fine their. The value for Date_Needed__c is not being touched by the controller for the page in either instance. Therefore they are nearly identical, but for some reason this particular form will not accept the date selected by the user. The calender widget does appear however, and visually it appears the date is being captured. It just does not come through in the record being created.

 

Any help would be greatly appreciated, this is the only broken piece of my app and I am just trying to fix this before final deployment.

I have been working on this issue for a few days now, trying to understand why this form will not capture the date entered using the standard salesforce functionality and date picker. What is weird is that I have another form using the exact same code to capture a date and it is working perfectly.

There are no referenced to the field in the controller for either page, yet the page that I have included below does not save the date, while the other form does.

 

This is the code for the inputfield that should store a value to NewForm.Date_Needed__c, I ripped right out of my component for the form:



 

 <apex:pageBlockSectionItem >
            <apex:outputLabel >When is the new account required by? </apex:outputLabel>
        </apex:pageBlockSectionItem>  
        
        <apex:pageBlockSectionItem >
            <apex:inputField required="true" value="{!NewForm.Date_Needed__c}"/>
        </apex:pageBlockSectionItem>  

 The only difference in the use of the code snippet between forms is placement. This is the second set of pageblocksection items in the pageblocksection for the form I am having trouble with, while the other form has it as the last set of items before the pageblocksection is closed. Any help would be appreciated, I understand this isnt much to go off of, I will upload my component and controller if anybody would find it helpful. I am hoping there is something wrong with this snippet, making this problem an easy fix.

Hello Folks,

 

I have been trying to install the Force.com IDE for over a month, and yet every time I run into trouble. Originally the issue was that once installed, when i tried to launch the app it would throw an error. This happened the first ten or so times I tried installing this tool. I gave up for a while, and yesterday a co worker of mine helped me install it, and it worked just fine. When I came in this morning however, I launched the program and I got the same error message. I would include it as an attachment but I do not see that as an option here. So, this has now happened to me on both of the machines I have to work on, and I cannot do the work I need to because the tool does not work on my machines. Today I reinstalled several times, and each time I had trouble downloading the software, and then even when the proxy was discovered automatically it could not connect. Finally I typed the proxy settings in, and it looked as if it was trying to connect, but could not actually download anything. It would get to the "preparing to download metadata..." part and go unresponsive. I am looking for some help getting this tool working, this is quite frustrating and I could definately use some guidance and assistance troubleshooting.

 

Thank You

I have been experiencing difficulty using an inputfield to capture a date value on a visualforce page. The code code I am using is: 

 

        <apex:pageBlockSectionItem >

<apex:outputLabel >When is the new account required by? </apex:outputLabel>

</apex:pageBlockSectionItem>

 

        <apex:pageBlockSectionItem >

        <apex:inputField required="true" value="{!NewForm.Date_Needed__c}"/>

        </apex:pageBlockSectionItem>                 

 

 

these pageBlockSectionItems are properly nested inside a pageblocksection, and a page block. The page is not throwing any errors, but the value is not being captured.

 

What is interesting is I am using the same code in a different component for another form and it is working just fine their. The value for Date_Needed__c is not being touched by the controller for the page in either instance. Therefore they are nearly identical, but for some reason this particular form will not accept the date selected by the user. The calender widget does appear however, and visually it appears the date is being captured. It just does not come through in the record being created.

 

Any help would be greatly appreciated, this is the only broken piece of my app and I am just trying to fix this before final deployment.

I have been working on this issue for a few days now, trying to understand why this form will not capture the date entered using the standard salesforce functionality and date picker. What is weird is that I have another form using the exact same code to capture a date and it is working perfectly.

There are no referenced to the field in the controller for either page, yet the page that I have included below does not save the date, while the other form does.

 

This is the code for the inputfield that should store a value to NewForm.Date_Needed__c, I ripped right out of my component for the form:



 

 <apex:pageBlockSectionItem >
            <apex:outputLabel >When is the new account required by? </apex:outputLabel>
        </apex:pageBlockSectionItem>  
        
        <apex:pageBlockSectionItem >
            <apex:inputField required="true" value="{!NewForm.Date_Needed__c}"/>
        </apex:pageBlockSectionItem>  

 The only difference in the use of the code snippet between forms is placement. This is the second set of pageblocksection items in the pageblocksection for the form I am having trouble with, while the other form has it as the last set of items before the pageblocksection is closed. Any help would be appreciated, I understand this isnt much to go off of, I will upload my component and controller if anybody would find it helpful. I am hoping there is something wrong with this snippet, making this problem an easy fix.

Hello Folks,

 

I have been trying to install the Force.com IDE for over a month, and yet every time I run into trouble. Originally the issue was that once installed, when i tried to launch the app it would throw an error. This happened the first ten or so times I tried installing this tool. I gave up for a while, and yesterday a co worker of mine helped me install it, and it worked just fine. When I came in this morning however, I launched the program and I got the same error message. I would include it as an attachment but I do not see that as an option here. So, this has now happened to me on both of the machines I have to work on, and I cannot do the work I need to because the tool does not work on my machines. Today I reinstalled several times, and each time I had trouble downloading the software, and then even when the proxy was discovered automatically it could not connect. Finally I typed the proxy settings in, and it looked as if it was trying to connect, but could not actually download anything. It would get to the "preparing to download metadata..." part and go unresponsive. I am looking for some help getting this tool working, this is quite frustrating and I could definately use some guidance and assistance troubleshooting.

 

Thank You

I'm seeing this error relatively frequently as I attempt to upsert data to Salesforce. However, it isn't 100% repeatable - if I try to run the same batch job again it is a different set of records that fails to upsert.

Some notes on our upload process:

1. We are using multi-threading to increase upload speed.
2. We are *not* upserting the same record at the same time with multiple threads. (A given record only appears once in the batch upload process).
3. The object we are upserting to does have an Apex trigger on it - but this trigger only modifies the record being updated, so we should not run into any locking issues here.
4. The object we are upserting is included in a roll-up summary.

I'm thinking that maybe it's the parent in the roll-up summary that is being locked? Does this sound plausible?

I'll be investigating further. Just wondering if anyone else has ever run into this error...

-Greg

Message Edited by glorge on 11-12-2008 05:10 PM
  • November 13, 2008
  • Like
  • 0