• benito camela
  • NEWBIE
  • 0 Points
  • Member since 2011

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

Hi, I have an email template (type:Visualforce) that is sent each time someone comment an Idea.

 

trigger myIdeas on Idea (after update) {
    
    if(Trigger.isAfter){
        for (Idea i : Trigger.new) {
			if(i.LastCommentDate > i.LastModifiedDate){
				Id emailId = [SELECT Id FROM EmailTemplate WHERE DeveloperName='New_Ideas_comment'].id;
				String[] toAddresses = new String[] {'test@test.com'}; 

				Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
				mail.setToAddresses(toAddresses);
				mail.setSenderDisplayName('test test');
				mail.setTemplateId(emailId);
				mail.setTargetObjectId(i.CreatedById);
				mail.saveAsActivity = false;
				Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
			}
        }
    }
    
}

 ... and my template:

<messaging:emailTemplate subject="The Idea {!relatedTo.title} has a new comment" recipientType="User" relatedToType="Idea">
<messaging:plainTextEmailBody >

Dear {!recipient.FirstName} {!recipient.LastName}

{!relatedTo.Title}

</messaging:plainTextEmailBody>
</messaging:emailTemplate>

 {!relatedTo.Title} is blank. Do you know what's the problem ?

 

 

The crazy thing is that when I use a template of type TEXT, it works !!!

 

e.g.: Subject: New Comment ({!Idea.NumComments}) on Idea: {!Idea.Title}

 

Thanks

Hi,

Currenty I have defined some content inside a Visualforce Component.

This Component is seen only when the user clicks a button.

I would like to load this Component when page finish the load or the user clicks on the button.

I thought set a boolean var in the constructor to false (shouldLoadTheComponent)

Set rendered = shouldLoadTheComponent in the component and onLoad, call an actionFunction that would set shouldLoadTheComponent = true and then rerender the component.

What do you think?

Pages be default inport JiffyStubs.js

Is there a way to NOT import it ?

 

My pages config is: sidebar="false" showHeader="false" standardStylesheets="false"

 

I saw that when standardStylesheets="TRUE" other css files are imported, is there a way to put them all together ?

Static resouces (images, css, js) are delivered with embed cookies data. But this adds additional request overhead. In other words, those resources such as images, JS and CSS files, don't need to be accompanied by cookies.

 

Does anyone have experience hosting those files outside salesforce infrastructure ?

Hi,

In my project, we define static resources, those are for example css and images.

By reading google performance recommendations, I found a chapter about Parallelize downloads across hostnames.

Basically, under certain circumstances, performance can be improved by using this approach.

My question is: as static resource are hosted on salesforce, which could be the best way to serve static resources from other than salesforce's host. Or: is Parallelize downloads across hostnames approach compatible with salesforce projects ? 

Thanks in advance.

Hi, I have an email template (type:Visualforce) that is sent each time someone comment an Idea.

 

trigger myIdeas on Idea (after update) {
    
    if(Trigger.isAfter){
        for (Idea i : Trigger.new) {
			if(i.LastCommentDate > i.LastModifiedDate){
				Id emailId = [SELECT Id FROM EmailTemplate WHERE DeveloperName='New_Ideas_comment'].id;
				String[] toAddresses = new String[] {'test@test.com'}; 

				Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
				mail.setToAddresses(toAddresses);
				mail.setSenderDisplayName('test test');
				mail.setTemplateId(emailId);
				mail.setTargetObjectId(i.CreatedById);
				mail.saveAsActivity = false;
				Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
			}
        }
    }
    
}

 ... and my template:

<messaging:emailTemplate subject="The Idea {!relatedTo.title} has a new comment" recipientType="User" relatedToType="Idea">
<messaging:plainTextEmailBody >

Dear {!recipient.FirstName} {!recipient.LastName}

{!relatedTo.Title}

</messaging:plainTextEmailBody>
</messaging:emailTemplate>

 {!relatedTo.Title} is blank. Do you know what's the problem ?

 

 

The crazy thing is that when I use a template of type TEXT, it works !!!

 

e.g.: Subject: New Comment ({!Idea.NumComments}) on Idea: {!Idea.Title}

 

Thanks

Static resouces (images, css, js) are delivered with embed cookies data. But this adds additional request overhead. In other words, those resources such as images, JS and CSS files, don't need to be accompanied by cookies.

 

Does anyone have experience hosting those files outside salesforce infrastructure ?

Hi Everyone,

                Today in our Dev orgs , we are facing a weird issue on one of our custom visual force page which shows date field using standard Salesforce Datepicker javascript. The issue is that date picker popup is not visible on click/focus of the date filed textbox.

 

 

Note : If i purposely give showHeader="true" then it shows the date picker. But this should not be the case as it was flexible earlier.

Can SF do any updates without any notifications ?

 

It was working fine before but the date fields stopped showing the nice popup calendar on sites now..!!!!!!!!!!!!!!!!!! please help???!!!

I am trying to create a trigger that sends an Email Alert (or just an email though Apex code) to the original Idea poster whenever a comment is left for their idea. In looking through the Apex documentation, I noticed it says you can only define triggers for top-level standard objects, but not for standard child objects. When I try to do something like this:

 

 

trigger commentEmail on IdeaComment (after insert) {
// send email code here
}

 

I get "Error: Compile Error: SObject type does not allow triggers: IdeaComment at line 1 column 25". Can anyone point in the right direction to get around this? 

 

 

 

Hi there. I have a trigger that fires when an idea is updated, such as when a comment is posted.
My problem is that I can't get the trigger to fire when an idea is promoted... any suggested work arounds?
I tried to have a trigger that fires on the Vote SObject, but this is not allowed...
Any info greatly welcomed.
Thank you
  • January 11, 2009
  • Like
  • 0