• davecruso
  • NEWBIE
  • 0 Points
  • Member since 2009

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 19
    Questions
  • 20
    Replies

Hi all, 

 

I wonder if anyone knows when the updated GUI will be released? Our app shows the Spring '10 ladybug, but the GUI still reflects the original (old) environment. Wasn't one of the updates a new/refreshed GUI?  

 

Thanks!

--Dave 

Greetings, 

 

We need to kick off a function (send update e-mail) based upon the checkbox status of a checkbox on an Apex form/page. However, it doesn't seem to be working right... is my code correct? Thanks for suggestions!

 

Apex Page Code:

 

 

<br>Check to send colleagues a notification e-mail when I save:

 

 

<apex:inputCheckbox value="{!Sendmails}" id="emailvalue"/>

 

 

 

 

 

 

Relevant Apex Controller Code:

 

 

private string Sendmails;

 

public string getSendmails() {

return Sendmails; }

 

public void setSendmails(string v) { sendmails = v; }

...

public PageReference save()

{

if (sendMails == '1') {

try{ // code here }

}

 

 

 Thanks again!

--Dave

Message Edited by davecruso on 02-03-2010 07:52 AM
Message Edited by davecruso on 02-03-2010 07:58 AM

Hi all, 

 

We're trying to generate a listing of attachments for a specific item (apprenticeship), but are having no luck with the outer query. The inner query (against Attachment) works. Any thoughts / suggestions? Thanks!  Here's our code:

 

 

   private List<Attachment> attachmentList;   

    public List<Attachment> getAttachments() {

           

      PageReference pageRef = System.currentPageReference();

        apprenticeshipID = pageRef.getParameters().get('id');

        

        for (Lesson_Plan_Attachments__c u: [select id,Apprenticeship__c from Lesson_Plan_Attachments__c where Lesson_Plan_Attachments__c.Apprenticeship__c = :apprenticeshipID limit 1]) 

        {

attachmentList = [select id from Attachment where parentid = :u.id ];

    }

    return attachmentList;

}

 

 

 

Message Edited by davecruso on 01-22-2010 12:39 PM

Hi there, 

 

I need to pass a variable from my VF page into an Apex controller, but am having trouble. Here's my use case:

 

A user fills out a form. She/he selects a box called "e-mail colleagues". If checked, the controller runs through a list of his/her colleagues and sends them an e-mail. If unchecked, that part of the controller is skipped when the form is posted.

 

So, there are two things I'm trying to accomplish:

 

(1) Get a checkbox into a page.

(2) Add a line to the controller that checks to see if the checkbox value of "1" or "yes" was posted, and if so, do some code. 

 

So far, I've been following the Apex:selectRadio tutorial, but this seems overkill for what I need to do. Are there any easier ways, and if so, might someone please post a sample snippet?

 

Thanks SO MUCH!

--Dave 

 

 

Hi there, 

 

We have a webform on one of our sites pages (lesson planning, so it can be somewhat involved), and recently received a complaint about a timeout.

 

I'd like to add a Javascript warning/timer in there, but would love to maximize the time before a warning popup appears.

 

Does anyone happen to know the timeout for Sites pages, or perhaps better, how to modify timeout times?

 

Thanks so much!

--Dave 

Hi all, 

 

I'm trying to pull a list of names from an object into a SingleEmailMessage send (about 3-5 recipients in each message, no more than 6 ever). The e-mail sends when someone updates a lesson plan, which is part of an apprenticeship.

 

Our objects are:

 

Contact = Stores the names and e-mail addresses

CT_Connector = Connects Contact with Apprenticeship

Apprenticeship = The name of the class

Lesson_Plan = A lesson within an apprenticeship  

 

However, it seems that, to make this happen, we have to pull a list of names into a String[] . So far, here's what I have. I'm not receiving any Apex errors, and it compiles / uploads, but the query isn't working when I use the application... any thoughts? 

 

Thanks! 

 

 

 

Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage(); List<String> toAddresses = new List<String>();for (CT_Connector__c u: [select Citizen_Teacher__r.Email from CT_Connector__c where Apprenticeships__r.Id = :lessonplan.id]) { toAddresses.add(u.Citizen_Teacher__r.Email); } mail.setToAddresses(toAddresses); // Specify the address used when the recipients reply to the email... etc

 

 

 

Hi all, 

 

We're looking to redevelop our nonprofit website (1k+ visitors/day), and would like to integrate more tightly with Salesforce. Since we have a significant number of people who are involved with updating content on the site, we need to stick with a nice, simple CMS to make it all happen.

 

Points of integration include:

> Multiple web to lead forms

> Events integration (for signup)

> Profile management (using the Contact object, for volunteers) 

 

 

I have been looking into both Drupal and Joomla, which seem to have varying capacities to integrate directly with Salesforce using pre-built modules (ideal). Other CMSs, e.g., some of the commercial vendors, say little about SF integration.

 

Are there other CMSs, open source, noncommercial or commercial, that would be worth exploring? I'd love thoughts and opinions!

 

Thanks so much, 

--Dave 

Hi there, 

 

We're running a Sites application at http://citizenschools.force.com/ctapp/ that allows people to sign up to be volunteers with our organization.

 

On Sunday, 10/11 at 11:30PM EST, we suddenly started to receive Apex Application errors (no changes had been made to the system that day, or in the preceding days).  

 

The error is:

 

Apex script unhandled exception by user/organization: 00540000000oi8Q/00D400000008qgXVisualforce Page: /ctapp/apex/CT_Application_Page4System.SObjectException: SObject row was retrieved via SOQL without querying the requested field: CT_Application__c.Region__cClass.ctApplicationPage4.<init>: line 17, column 14External entry pointDebug Log:

 

Any ideas about what could have gone wrong, and where? We're thinking it's a permissions/access issue, but nothing seems to have changed!

 

Thanks so much,

--Dave 

Hi all, 

 

We've just migrated our application from Preproduction to Production on our sites deployment. One of the objects, "Apprenticeship", provides the ability for Guest users to upload, download and remove files. 

 

Guest users can upload and remove files, but can't download the files - which worked on Preproduction, but doesn't seem to work on Production.

 

The error comes when the Guest user tries to access the file/download servlet located on the FILES tab. Compare:

 

This site is working: http://citizenschools.preprod.cs2.force.com/lessons/CTN_Apprenticeship?id=a0GR000000190tPMAQ&ctContactId=003R000000Ea03n

 

And this site is not: http://citizenschools.force.com/lessonplanning/CTN_Apprenticeship?id=a0G40000000uIMGEA2&ctContactId=0034000000YTrDKAA1

 

... despite that the Custom Object has read/edit permission set & that there are no other apparent differences between objects and sites. 

 

Any suggestions about how to resolve? Other information needed to figure it out? Thanks SO MUCH for your help!

 

--Dave

 

Message Edited by davecruso on 08-14-2009 12:57 PM

Hi all, 

 

We're trying to troubleshoot an issue with the constructor query, and would love to get a try/catch working with it. We're getting a List error (out of bounds) sometimes, but can't seem to replicate regularly...

 

Any suggestions about how to get a try/catch working? Maybe call a method (not sure how this would look)?

 

Here's our code:

 

 

public CT_ApplicationPage6() { PageReference pageRef = System.currentPageReference(); string x = pageRef.getParameters().get('id'); List <CT_Application__c> cta = [Select Contact__r.firstname, Region__r.Name,Region__r.Volunteer_Manager__r.firstname, Region__r.Volunteer_Manager__r.lastname,Region__r.Volunteer_Manager__r.email From CT_Application__c where Contact__c=:x order by createddate desc]; setconid(cta[0].id); setconfName(cta[0].Contact__r.firstname); setregion(cta[0].Region__r.Name); setvmemail(cta[0].Region__r.Volunteer_Manager__r.email); setvmName(cta[0].Region__r.Volunteer_Manager__r.firstname + ' ' + cta[0].Region__r.Volunteer_Manager__r.lastname); //get trainnig date List <Training_Registration__c> tr = [SELECT Location__c,Training_Date__r.Training_Date__c FROM Training_Registration__c where Contact__c=:x]; List <String> td = String.valueOF(tr[0].Training_Date__r.Training_Date__c).split('-'); setTrnDate(td[1] + '-' + td[2] + '-' + td[0]); }

 

 Try / Catch Code: 

 

 

catch(exception ex) { PageReference errorPage = Page.Exception; errorPage.getParameters().Put('error',ex.getMessage()); return errorPage; }

 

Thanks for your suggestions and thoughts!

 

--Dave 

 

 

 

Hi all,

 

I'm using getUrl to help redirect users after they post (upsert) data through a controller. However, when the page refreshes, the URL string contains all sorts of weird data (acutally, the post data itself). Any ideas about how to cleanse this out, and only return the URL string, e.g.,

 

https://c.cs2.visual.force.com/apex/CTN_Lessons_12  

 

instead of

 

https://c.cs2.visual.force.com/apex/CTN_Lessons_12?apprenticeshipId=a0GR000000190tPMAQ&com.salesforce.visualforce.ViewStateCSRF=.81nmB5NLIKSowfGW68Ozh1YbfyQRA_PK9vLzSMZ3B_DbvoIIPncNlNIIPA6744H7JTmluAAQsrSYvwoegMBZ.aPpHdlcZMSZmDIIi2y05XT7rqH4KEw6M2yM8vez7ChXCXnKw8lY0REsEIBobzuEt2hXVY%3D&ctContactId=003R000000Ea03n&id=a0eR0000000IqirIAC&j_id0%3Aj_id13=j_id0%3Aj_id13&j_id0%3Aj_id13%3AActivity_1__c=asdads&j_id0%3Aj_id13%3AActivity_1_Time__c=&j_id0%3Aj_id13%3AActivity_2__c=asdads&j_id0%3Aj_id13%3AActivity_2_Time__c=&j_id0%3Aj_id13%3AActivity_3__c=&j_id0%3Aj_id13%3AActivity_3_Time__c=&j_id0%3Aj_id13%3AAgenda=tst&j_id0%3Aj_id13%3ACollege_Career=asdasd&j_id0%3Aj_id13%3ACT_Introduction__c=&j_id0%3Aj_id13%3ACT_Introduction_Time__c=&j_id0%3Aj_id13%3ADebrief_Questions__c=&j_id0%3Aj_id13%3ADebrief_Questions_Time__c=&j_id0%3Aj_id13%3Aj_id15=j_id0%3Aj_id13%3Aj_id15&j_id0%3Aj_id13%3AMaterials=asdasd&j_id0%3Aj_id13%3AObjectives=test&j_id0%3Aj_id13%3ARitual=&j_id0%3Aj_id13%3ARitual_Time__c=&j_id0%3Aj_id13%3AWOW_em__c=&j_id0%3Aj_id13%3AWOW_em_Time__c=?apprenticeshipId=a0GR000000190tPMAQ 

 

...?

 

Here's my code:

 

 

public PageReference save() { PageReference pageRef = System.currentPageReference(); url = pageRef.getUrl(); try{ if (pageRef.getParameters().get('lessonNumber') != null) { lessonplan.Lesson_Number__c = pageRef.getParameters().get('lessonNumber'); } lessonplan.Name = 'Web Submission'; lessonplan.Apprenticeship__c = pageRef.getParameters().get('apprenticeshipId'); lessonplan.Last_CT_Modified__c = pageRef.getParameters().get('ctContactId'); upsert(lessonplan); }catch(Exception e){ String myErr = '?err=' + e.getMessage(); PageReference ref = new PageReference('/apex/testerr' + myErr); ref.setRedirect(true); return ref; } // url = '/apex/CTN_Lessons_12'; lessonid = lessonplan.id; apprenticeshipId = pageRef.getParameters().get('apprenticeshipId'); ctContactId = pageRef.getParameters().get('ctContactId'); urlstring = url + '?apprenticeshipId=' + apprenticeshipId + '&ctContactId=' + ctContactId + '&id=' + lessonid; // urlstring = url + '?id=' + apprenticeshipId + '&ctContactId=' + ctContactId; PageReference ref = new PageReference(urlstring); ref.setRedirect(true); return ref; }

 

 Thanks for your help!

 

Hi all, 

 

Following up from an earlier thread; we have created a Visualforce e-mail template that we are calling through a trigger. When we preview the e-mail template with data that we enter (via preview), it works.

 

However, when the e-mail is sent via trigger upon the creation of a new entry in the object, the e-mail is sent without information populating the Apex fields.  

 

Does anyone know why this happens, and what steps we can take to remedy / explore for a remedy? (We have the latest release of SF)

 

Thanks!

--Dave 

Hi all, 

 

 

We're sending a thank-you e-mail to individuals who sign up through our sites-based system. The mail is sent through a controller (see code below).

 

 

try{ //String[] ccAddresses = new String[]{'user@gmail.com'}; mail.setToAddresses(toAddresses); //mail.setCcAddresses(ccAddresses); mail.setReplyTo(VMEmail); mail.setSenderDisplayName('Name'); mail.setSubject('Application Confirmation'); mail.setPlainTextBody('It is done - this text needs to be MUCH longer and more complex, with html code too'); Messaging.sendEmail(new Messaging.SingleEmailMessage[]{mail}); }catch(Exception e){ String url = '/apex/exception?err=line135' + e.getmessage(); PageReference r = new PageReference(url); return r; }

 

 

 

 

What is the simplest way to send a mid-sized e-mail that includes some HTML formatting? Should we pop all of the escaped text and HTML into the Apex controller? Place in an external file? If so, how do we place in an external file?

 

Thanks for your suggestions!

--Dave 

Hey all, 

 

We're in the middle of doing our best to roll out a production site. Each site page has a number of elements that gather display or gather data, including static resources and Apex forms.

 

Of course, many of our data fields are acted upon by Javascript that validate certain things prior to submit, or that perform operations not handled by Apex, prior to submit.

 

We're hitting a big challenge, which is that each element is assigned an ID, but that IDs are NOT static; they seem to depend upon the order that the element falls within the page. For instance, our form has the following name, now:

 

 

<form id="j_id0:CT_App_Template:j_id10" ..../>

 

 but had a different id (13) earlier, and still a different id prior to that.  These changing IDs make for very confusing and bug-prone development, especially because there are quite a few elements on each page, and the number of elements changes as we add or subtract visual elements (referred to as static resources).

 

This is causing us to push static resources to other servers, for instance, hosting on internal sites that we can refer to directly, rather than dealing with the issue of changing IDs.

 

Has anyone run into & found a solution to this aggravating issue, and/or is there a way to catch and dynamically assign the ID, or tell a resource to always use the SAME id,  on a consistent basis?

 

Thanks for your support!

--Dave 

 

Hi all, 

 

We're running into a restriction that presents a significant challenge to the application that we're deploying. Here's a vignette:

 

We're accepting volunteer applications for educational programs operated by our nonprofit. Applicants are new, or repeat volunteers (existing).  

 

Volunteer information is a Contact, as well as a custom object (Application).

 

We ask users for their e-mail, and validate that against Contacts; if the Contact exists, we pull up their record so they can edit, and so they can create and submit a new application.

 

New volunteers have to create themselves a Contact record, and the required application.

 

However: in cases when a Contact exists, he or she is unable, through sites, to edit their record. It seems that sites does not provide EDIT capabilities on the Contact object; only Read and Create.

 

Is there any way to set Edit, such that one of our volunteers can edit their public record? Any way to customize the application to make this possible?

 

Thanks for the help!

--Dave 

Hey all, 

 

We have a pretty simple web-to-lead form online, http://ctnation.citizenschools.net/dotnetnuke/Volunteer/5000WOWsCampaign/tabid/182/Default.aspx#form . Nothing complex, and most of the data submits without any issue.

 

However, recordType does not submit successfully. Whatever we do, it defaults to the 1st choice, rather than the value we need it to set. Here's our code:

 

 

<select style="display:none;" id="recordType" name="recordType"><option value="012400000005Udz">Potential Volunteer</option></select>I've also tried:<input type="hidden" id="recordType" name="recordType" value="012400000005Udz">

 

Does anyone have suggestions about why recordType isn't setting correctly? Anything else we can check?

 

Thanks!

--Dave 

 

 

Hi all, 

 

We're developing two Sites; they're exactly the same except for the fact that on ONE Site, the cache is flushing, and on the OTHER page, the pages are NOT refreshing. Cache settings are all set to false, and expires=1. Any ideas?

 

Thanks!

--Dave 

Hi all, 

 

Related to an earlier request for an IRC channel, I'm going to try to start one. I welcome any/all to join on #salesforce-dev, on the irc.freenode.net server. Join us, idle, help us build the live community!

 

Details:
 
Server: irc.freenode.net
Channel: #salesforce-dev
 
Clients:
 
Colloquy (OSX) - http://colloquy.info/downloads.html
MIRC (PC) - http://www.mirc.com/
 
Web-based (Java) - http://java.freenode.net/
 
Notes:
 
It would be great if word of the IRC support channel was spread further, and if others would join/idle if the channel were empty. Ideally, SF developer staff might like to join and converse with individuals seeking support  although it happens here in the forums, additional interaction might be great. 

 
Cheers,
--Dave 

Hi all, 

 

After some poking and prodding, I've gotten file attachments to work. Files are associated with apprenticeships; here's the code that I'm using for the controller extension

 

 

public PageReference deletefile() {

PageReference pageRef = System.currentPageReference();

apprenticeshipId = pageRef.getParameters().get('id');

ctContactId = pageRef.getParameters().get('ctContactId');

url = '/apex/CTN_Apprenticeship';

 

fileId = System.currentPageReference().getParameters().get('fileId');

attachment = [select Apprenticeship__c.attachment__r.id from Apprenticeship__c where attachment__r.id = 'fileId'];

delete attachment;

 

urlstring = url + '?id=' + apprenticeshipId + '&ctContactId=' + ctContactId;

PageReference ref = new PageReference(urlstring); ref.setRedirect(true); return ref;

}

 

 

 

 

The question is about how users can remove files. How do I query the NotesAndAttachments child object? I've tried a bunch of things, but all seem to throw errors (and googling "NotesAndAttachments" only pulls up minimal results!).

 

Has anyone been through this? Does anyone have suggestions about what a simple query might look like that I could use to populate a deletefile() action, or point me toward a code snippet that might accomplish the same? Thanks so much!

 

--Dave 

 

 

Message Edited by davecruso on 06-03-2009 08:56 AM
Message Edited by davecruso on 06-03-2009 08:57 AM
Message Edited by davecruso on 06-03-2009 08:58 AM

Hi there, 

 

I have a list of products, and would like to relate each product to other products. I can create a lookup relationship, but this isn't quite right; each product has one, but in most cases more, related projects. How can we create this relationship?

 

I have tried:

 

Master-Detail through a connector object (doesn't seem to work, since the connector objects have to be unique)

Lookup relationship (doesn't seem to work because the lookup can only be to a single instance of each object)

 

Any other ideas?

 

Thanks!

--Dave 

Greetings all, 

 

I'm building an application with a modestly more interesting object structure that I've attempted in the past, and would love your thoughts about how to accomplish it. The database will help us develop free math learning tools for elementary and middle school kids (we're a SF Foundation-supported 501(c)(3)).

 

Diagram

 

Here's a simple schematic [pdf link], and what follows is a description:

 

Mathematical Operations: Has a many-to-many connector with Concepts, Relations, Properties.  

 

Mathematical Concepts:Has a many-to-many connector relation with Operations.

 

Mathematical Relations: Has a many-to-many connector relation with Operations. 

 

Mathematical Properties: Has a many-to-many connector relation with Operations. 

 

Test Scores: Currently has a lookup relation to Operations, Concepts, Relations and Properties.  

 

Bugs: Currently has a lookup relation to Operations, Concepts, Relations and Properties.

 

 

Our Challenge:

 

It turns out that we also need for Test Scores to have a many-to-many relationship with all core objects (Operations, Concepts, Relations, Properties). However, it seems that each object can only have a single Master-Detail relationship -- is this the case?

 

If so, is there any way we can accomplish this diagram?

 

Thanks!

--Dave 

 

 

Greetings, 

 

We need to kick off a function (send update e-mail) based upon the checkbox status of a checkbox on an Apex form/page. However, it doesn't seem to be working right... is my code correct? Thanks for suggestions!

 

Apex Page Code:

 

 

<br>Check to send colleagues a notification e-mail when I save:

 

 

<apex:inputCheckbox value="{!Sendmails}" id="emailvalue"/>

 

 

 

 

 

 

Relevant Apex Controller Code:

 

 

private string Sendmails;

 

public string getSendmails() {

return Sendmails; }

 

public void setSendmails(string v) { sendmails = v; }

...

public PageReference save()

{

if (sendMails == '1') {

try{ // code here }

}

 

 

 Thanks again!

--Dave

Message Edited by davecruso on 02-03-2010 07:52 AM
Message Edited by davecruso on 02-03-2010 07:58 AM

Hi all, 

 

We're trying to generate a listing of attachments for a specific item (apprenticeship), but are having no luck with the outer query. The inner query (against Attachment) works. Any thoughts / suggestions? Thanks!  Here's our code:

 

 

   private List<Attachment> attachmentList;   

    public List<Attachment> getAttachments() {

           

      PageReference pageRef = System.currentPageReference();

        apprenticeshipID = pageRef.getParameters().get('id');

        

        for (Lesson_Plan_Attachments__c u: [select id,Apprenticeship__c from Lesson_Plan_Attachments__c where Lesson_Plan_Attachments__c.Apprenticeship__c = :apprenticeshipID limit 1]) 

        {

attachmentList = [select id from Attachment where parentid = :u.id ];

    }

    return attachmentList;

}

 

 

 

Message Edited by davecruso on 01-22-2010 12:39 PM

Hi there, 

 

I need to pass a variable from my VF page into an Apex controller, but am having trouble. Here's my use case:

 

A user fills out a form. She/he selects a box called "e-mail colleagues". If checked, the controller runs through a list of his/her colleagues and sends them an e-mail. If unchecked, that part of the controller is skipped when the form is posted.

 

So, there are two things I'm trying to accomplish:

 

(1) Get a checkbox into a page.

(2) Add a line to the controller that checks to see if the checkbox value of "1" or "yes" was posted, and if so, do some code. 

 

So far, I've been following the Apex:selectRadio tutorial, but this seems overkill for what I need to do. Are there any easier ways, and if so, might someone please post a sample snippet?

 

Thanks SO MUCH!

--Dave 

 

 

Hi there, 

 

We have a webform on one of our sites pages (lesson planning, so it can be somewhat involved), and recently received a complaint about a timeout.

 

I'd like to add a Javascript warning/timer in there, but would love to maximize the time before a warning popup appears.

 

Does anyone happen to know the timeout for Sites pages, or perhaps better, how to modify timeout times?

 

Thanks so much!

--Dave 

Hi all, 

 

We're looking to redevelop our nonprofit website (1k+ visitors/day), and would like to integrate more tightly with Salesforce. Since we have a significant number of people who are involved with updating content on the site, we need to stick with a nice, simple CMS to make it all happen.

 

Points of integration include:

> Multiple web to lead forms

> Events integration (for signup)

> Profile management (using the Contact object, for volunteers) 

 

 

I have been looking into both Drupal and Joomla, which seem to have varying capacities to integrate directly with Salesforce using pre-built modules (ideal). Other CMSs, e.g., some of the commercial vendors, say little about SF integration.

 

Are there other CMSs, open source, noncommercial or commercial, that would be worth exploring? I'd love thoughts and opinions!

 

Thanks so much, 

--Dave 

Hi there, 

 

We're running a Sites application at http://citizenschools.force.com/ctapp/ that allows people to sign up to be volunteers with our organization.

 

On Sunday, 10/11 at 11:30PM EST, we suddenly started to receive Apex Application errors (no changes had been made to the system that day, or in the preceding days).  

 

The error is:

 

Apex script unhandled exception by user/organization: 00540000000oi8Q/00D400000008qgXVisualforce Page: /ctapp/apex/CT_Application_Page4System.SObjectException: SObject row was retrieved via SOQL without querying the requested field: CT_Application__c.Region__cClass.ctApplicationPage4.<init>: line 17, column 14External entry pointDebug Log:

 

Any ideas about what could have gone wrong, and where? We're thinking it's a permissions/access issue, but nothing seems to have changed!

 

Thanks so much,

--Dave 

Hi all, 

 

We've just migrated our application from Preproduction to Production on our sites deployment. One of the objects, "Apprenticeship", provides the ability for Guest users to upload, download and remove files. 

 

Guest users can upload and remove files, but can't download the files - which worked on Preproduction, but doesn't seem to work on Production.

 

The error comes when the Guest user tries to access the file/download servlet located on the FILES tab. Compare:

 

This site is working: http://citizenschools.preprod.cs2.force.com/lessons/CTN_Apprenticeship?id=a0GR000000190tPMAQ&ctContactId=003R000000Ea03n

 

And this site is not: http://citizenschools.force.com/lessonplanning/CTN_Apprenticeship?id=a0G40000000uIMGEA2&ctContactId=0034000000YTrDKAA1

 

... despite that the Custom Object has read/edit permission set & that there are no other apparent differences between objects and sites. 

 

Any suggestions about how to resolve? Other information needed to figure it out? Thanks SO MUCH for your help!

 

--Dave

 

Message Edited by davecruso on 08-14-2009 12:57 PM

Hi all, 

 

We're trying to troubleshoot an issue with the constructor query, and would love to get a try/catch working with it. We're getting a List error (out of bounds) sometimes, but can't seem to replicate regularly...

 

Any suggestions about how to get a try/catch working? Maybe call a method (not sure how this would look)?

 

Here's our code:

 

 

public CT_ApplicationPage6() { PageReference pageRef = System.currentPageReference(); string x = pageRef.getParameters().get('id'); List <CT_Application__c> cta = [Select Contact__r.firstname, Region__r.Name,Region__r.Volunteer_Manager__r.firstname, Region__r.Volunteer_Manager__r.lastname,Region__r.Volunteer_Manager__r.email From CT_Application__c where Contact__c=:x order by createddate desc]; setconid(cta[0].id); setconfName(cta[0].Contact__r.firstname); setregion(cta[0].Region__r.Name); setvmemail(cta[0].Region__r.Volunteer_Manager__r.email); setvmName(cta[0].Region__r.Volunteer_Manager__r.firstname + ' ' + cta[0].Region__r.Volunteer_Manager__r.lastname); //get trainnig date List <Training_Registration__c> tr = [SELECT Location__c,Training_Date__r.Training_Date__c FROM Training_Registration__c where Contact__c=:x]; List <String> td = String.valueOF(tr[0].Training_Date__r.Training_Date__c).split('-'); setTrnDate(td[1] + '-' + td[2] + '-' + td[0]); }

 

 Try / Catch Code: 

 

 

catch(exception ex) { PageReference errorPage = Page.Exception; errorPage.getParameters().Put('error',ex.getMessage()); return errorPage; }

 

Thanks for your suggestions and thoughts!

 

--Dave 

 

 

 

Hi all,

 

I'm using getUrl to help redirect users after they post (upsert) data through a controller. However, when the page refreshes, the URL string contains all sorts of weird data (acutally, the post data itself). Any ideas about how to cleanse this out, and only return the URL string, e.g.,

 

https://c.cs2.visual.force.com/apex/CTN_Lessons_12  

 

instead of

 

https://c.cs2.visual.force.com/apex/CTN_Lessons_12?apprenticeshipId=a0GR000000190tPMAQ&com.salesforce.visualforce.ViewStateCSRF=.81nmB5NLIKSowfGW68Ozh1YbfyQRA_PK9vLzSMZ3B_DbvoIIPncNlNIIPA6744H7JTmluAAQsrSYvwoegMBZ.aPpHdlcZMSZmDIIi2y05XT7rqH4KEw6M2yM8vez7ChXCXnKw8lY0REsEIBobzuEt2hXVY%3D&ctContactId=003R000000Ea03n&id=a0eR0000000IqirIAC&j_id0%3Aj_id13=j_id0%3Aj_id13&j_id0%3Aj_id13%3AActivity_1__c=asdads&j_id0%3Aj_id13%3AActivity_1_Time__c=&j_id0%3Aj_id13%3AActivity_2__c=asdads&j_id0%3Aj_id13%3AActivity_2_Time__c=&j_id0%3Aj_id13%3AActivity_3__c=&j_id0%3Aj_id13%3AActivity_3_Time__c=&j_id0%3Aj_id13%3AAgenda=tst&j_id0%3Aj_id13%3ACollege_Career=asdasd&j_id0%3Aj_id13%3ACT_Introduction__c=&j_id0%3Aj_id13%3ACT_Introduction_Time__c=&j_id0%3Aj_id13%3ADebrief_Questions__c=&j_id0%3Aj_id13%3ADebrief_Questions_Time__c=&j_id0%3Aj_id13%3Aj_id15=j_id0%3Aj_id13%3Aj_id15&j_id0%3Aj_id13%3AMaterials=asdasd&j_id0%3Aj_id13%3AObjectives=test&j_id0%3Aj_id13%3ARitual=&j_id0%3Aj_id13%3ARitual_Time__c=&j_id0%3Aj_id13%3AWOW_em__c=&j_id0%3Aj_id13%3AWOW_em_Time__c=?apprenticeshipId=a0GR000000190tPMAQ 

 

...?

 

Here's my code:

 

 

public PageReference save() { PageReference pageRef = System.currentPageReference(); url = pageRef.getUrl(); try{ if (pageRef.getParameters().get('lessonNumber') != null) { lessonplan.Lesson_Number__c = pageRef.getParameters().get('lessonNumber'); } lessonplan.Name = 'Web Submission'; lessonplan.Apprenticeship__c = pageRef.getParameters().get('apprenticeshipId'); lessonplan.Last_CT_Modified__c = pageRef.getParameters().get('ctContactId'); upsert(lessonplan); }catch(Exception e){ String myErr = '?err=' + e.getMessage(); PageReference ref = new PageReference('/apex/testerr' + myErr); ref.setRedirect(true); return ref; } // url = '/apex/CTN_Lessons_12'; lessonid = lessonplan.id; apprenticeshipId = pageRef.getParameters().get('apprenticeshipId'); ctContactId = pageRef.getParameters().get('ctContactId'); urlstring = url + '?apprenticeshipId=' + apprenticeshipId + '&ctContactId=' + ctContactId + '&id=' + lessonid; // urlstring = url + '?id=' + apprenticeshipId + '&ctContactId=' + ctContactId; PageReference ref = new PageReference(urlstring); ref.setRedirect(true); return ref; }

 

 Thanks for your help!

 

Hi all, 

 

 

We're sending a thank-you e-mail to individuals who sign up through our sites-based system. The mail is sent through a controller (see code below).

 

 

try{ //String[] ccAddresses = new String[]{'user@gmail.com'}; mail.setToAddresses(toAddresses); //mail.setCcAddresses(ccAddresses); mail.setReplyTo(VMEmail); mail.setSenderDisplayName('Name'); mail.setSubject('Application Confirmation'); mail.setPlainTextBody('It is done - this text needs to be MUCH longer and more complex, with html code too'); Messaging.sendEmail(new Messaging.SingleEmailMessage[]{mail}); }catch(Exception e){ String url = '/apex/exception?err=line135' + e.getmessage(); PageReference r = new PageReference(url); return r; }

 

 

 

 

What is the simplest way to send a mid-sized e-mail that includes some HTML formatting? Should we pop all of the escaped text and HTML into the Apex controller? Place in an external file? If so, how do we place in an external file?

 

Thanks for your suggestions!

--Dave 

Hi all, 

 

We're developing two Sites; they're exactly the same except for the fact that on ONE Site, the cache is flushing, and on the OTHER page, the pages are NOT refreshing. Cache settings are all set to false, and expires=1. Any ideas?

 

Thanks!

--Dave 

Might there be an IRC channel where Visualforce and/or APEX developers gather to chat?

 

If not, are there others interested in starting one?

 

Hi There,

Does anyone know of any desktop integration what integrates salesforce with Mac Mail on MAC OSX 10.5.2??

Thanks