• DF
  • NEWBIE
  • 0 Points
  • Member since 2008

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

Effectively I'm trying to recreate the Bounced Email Tracking on the standard Lead object. It would be very useful if Email Addresses on custom objects where able to be marked as a bounced email if the workflow email alert bounces.

 

Any direction on how to accomplish this would be much appreciated.

  • February 15, 2011
  • Like
  • 0

So I've done some searching and this seems to be a fairly common problem. I am in fact under the impression that there is no easy fix. Any guidance or direction would be greatly appreciated.

 

In a nutshell:

 

I created a custom object to represent certain types of clients. I cannot however send them an email directly from the records send an email button. The task looks for a contact and does not accept an arbitrary email address in its "to" field.

 

Any help would be greatly appreciated.

  • February 03, 2011
  • Like
  • 0

Any ideas on how this can be done? I'm out of them.

 

Basically a trigger is fired on the update of a record. When a particular field is changed, I would like to fire a mass email. Unfortunately no matter what I try to do, the email always comes from the person to modify the record, not the owner. 

 

I can't use SingleEmailMessage since the trigger may need to fire more then 10 emails. MassEmail's don't use Organization wide addresses. I am thus left with a spoofed email and a reply to. The actual "from" address however is still the modifiers....

 

Any suggestions or advice would be muuuuch appreciated. 

 

Thanks.

Message Edited by DF on 12-15-2009 12:01 PM
  • December 15, 2009
  • Like
  • 0

trigger Testmodify on Lead (after update) { User [] umail = [Select u.Email,u.Name from User u where id=:Trigger.new[0].OwnerId]; Lead [] lid = [Select Id from Lead where id=:Trigger.new[0].Id]; for (Lead tmp:lid) { tmp.LastModifiedById = umail[0].Id; update tmp; } }

 

Any ideas on why this code isn't being saved to the server ?

  • December 15, 2009
  • Like
  • 0

A quick summary on what I'm trying to accomplish here. 

 

We built a set of workflow rules that update a particular field after the elapse of a certain period of time. This field contains the template name of the email we wish to send to the records being updated. 

 

The issue is we cannot get the Message to actually come from the Lead Record Owner. I can spoof it(setting Display Name) or even set a reply to. The sender email address however remains as the last modifier.

 

I've been struggling with this for quite some time now. Every solution I find eventually runs into one problem or the next. Any advice or help on how this can be accomplished would be greatly appreciated.

 

Thanks!

 

My code is posted below. 

 

 

trigger testingemail on Lead (before update) {
   
                Set<Id> Oid = new Set<Id> {};

                for (Integer i = 0; i < Trigger.new.size(); i++) {
                   
                        if (Trigger.new[i].Email_List__c != Trigger.old[i].Email_List__c){
                           
                            //If the trigger does not contain account exec.   
                            //if(!Oid.contains(Trigger.new[i].OwnerID)){   
                                Oid.add(Trigger.new[i].OwnerId);
                            //}
                       
                    }
                }
              
               EmailTemplate[] eid = [select e.Id,e.Name from EmailTemplate e where name=:Trigger.new[0].Email_List__c];
              
               if(Oid.size() < 10 && Oid.size() > 0){
                      for (Id o_id : Oid){
                         
                          Id[] leadList = new Id[] {};
                          for (Integer i = 0; i < Trigger.new.size(); i++) {
                               if ((Trigger.new[i].Email_List__c != Trigger.old[i].Email_List__c) && (Trigger.new[i].OwnerId == o_id)){
                                  
                               leadList.add(Trigger.new[i].Id);
                          
                               }
                          }
                          if(LeadList.size()!=0)
                          {
                          User [] umail = [Select u.Email,u.Name from User u where id=:o_id];
                             
                          Messaging.MassEmailMessage mail = new Messaging.MassEmailMessage();
                         
                          mail.setTargetObjectIds(leadList);
                   
                        mail.setTemplateId(eid[0].Id);
                       
                        mail.setReplyTo(umail[0].Email);
                        mail.setSenderDisplayName(umail[0].Name);
                       
                        Messaging.sendEmail(new Messaging.MassEmailMessage[] { mail });
                          }
                         
                       }   
                      
                      
                      
                      
               }   
}       

  • December 14, 2009
  • Like
  • 0

I'm kinda new to apex, and im fairly stranded. Trying to basically create a trigger that on the completion of a log a call task, reads a particular field, and updates status based on it. More specifically, I'm not sure if what i want to do is possible.

 

To update  the lead shouldn't be too difficult. I would just run a SOQL on the lead Id and update the status field. I do this all day long from the API. The problem I'm really having is how to get information out of the current task. That is, how do i know what lead and what the contents of the tasks field are. 

 

Any help or direction would be much appreciated!

  • November 30, 2009
  • Like
  • 0
Can some one please help me out, I am having trouble figuring out how to create this.
 
I need an S-control  to set a checkbox value to true when call log pick list value is set and call log is saved.
 
Any help is greatly appriciated.
 
Thank you in advance.
  • May 21, 2008
  • Like
  • 0
Hi all,


Is there anyway to change this? when i create a workflow email alert that goes out to customers, the email is using my email adress to send it out, i would want the lead owner to be the sender.
any way to accomplish this?

Thank you,
any help is appriciated
  • April 29, 2008
  • Like
  • 0

So I've done some searching and this seems to be a fairly common problem. I am in fact under the impression that there is no easy fix. Any guidance or direction would be greatly appreciated.

 

In a nutshell:

 

I created a custom object to represent certain types of clients. I cannot however send them an email directly from the records send an email button. The task looks for a contact and does not accept an arbitrary email address in its "to" field.

 

Any help would be greatly appreciated.

  • February 03, 2011
  • Like
  • 0

trigger Testmodify on Lead (after update) { User [] umail = [Select u.Email,u.Name from User u where id=:Trigger.new[0].OwnerId]; Lead [] lid = [Select Id from Lead where id=:Trigger.new[0].Id]; for (Lead tmp:lid) { tmp.LastModifiedById = umail[0].Id; update tmp; } }

 

Any ideas on why this code isn't being saved to the server ?

  • December 15, 2009
  • Like
  • 0

ALL,

 

I am not new to developing on Salesforce using the API and PHP, but  I am new to APEX so please bare with me.

 

I wrote this simple trigger that deletes records on a custom object when another custom object record is deleted.

 

 

trigger CleanOppTrackerLineItem on Opportunity_Trackers__c (before delete) { for (Integer i = 0; i < Trigger.old.size(); i++) { try { //Get all the line items to delete when the parent is removed Opportunity_Tracker_Products__c[] oTRs = [select id from Opportunity_Tracker_Products__c where Opportunity_Tracker__c = :trigger.old[i].id]; delete oTRs; } catch (System.QueryException ex) { //Do Nothing - There must not have been any to delete. } } }

 

 I was trying to go over some of the examples so I can test this and I am kind of lost. 

 

 

Do I need to write a custom APEX class to test this trigger because I need to get it into production as fast as possible.

 

We have run some tests in our sandbox on the trigger and it works perfectly.

 

Can someone please help me with what is the simplest way to create a test case and get it tested for this very simple trigger

 

 

I would appreciate it

 

~Mike

 

Can some one please help me out, I am having trouble figuring out how to create this.
 
I need an S-control  to set a checkbox value to true when call log pick list value is set and call log is saved.
 
Any help is greatly appriciated.
 
Thank you in advance.
  • May 21, 2008
  • Like
  • 0