• Zimmer
  • NEWBIE
  • 50 Points
  • Member since 2010

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

We are getting some emails where the Web Email field is not populating on the resulting case.  Why is this happing?  Are certain email clients "hiding" this information?  Has anyone else experienced this?

  • February 15, 2012
  • Like
  • 0

Is this possible? Is so how? 

 

Basically after insert with a case I want to open an external website to the user while keeping sfdc open also.

 

Phil

  • September 07, 2011
  • Like
  • 0

I am writing a trigger to update a duration field on the lead, after the first sales activity is logged under a lead.

 

I had the code working in the sandbox and deployed to production.  I started getting the dreaded referencing a null object error on this statement.

string.valueOf(newTask.WhoId).startsWith('00Q')

 so i added the null check in front of it.  Now I am no longer getting the error but my code not populating the field on the lead record anymore.  It is almost as if the null check is booting all records and non get to the internal if's.

 

Thoughts?  I have copied my entire code as it exists right now below.

 

Phil

 

trigger ActivityFirstContact on Task (after insert) {

List<Lead> updatedLeads= new List<Lead>(); Datetime d = datetime.newInstance(2011, 8, 10); for(Task newTask:Trigger.new){ boolean notmarketuser = TRUE; if (newTask.Created_By_Role__c.contains('Marketing')) notmarketuser = FALSE; if(newTask.WhoID != NULL){ if(string.valueOf(newTask.WhoId).startsWith('00Q') &&
newTask.Subject != 'Lead Source Details' && notmarketuser) { Lead changedLead = [select id, First_Contact_Number__c, CreatedDate from lead where id=:NewTask.WhoId]; if(changedLead.CreatedDate > d && changedLead.First_Contact_Number__c==NULL) { changedLead.First_Contact_Number__c= decimal.valueof((newTask.CreatedDate.getTime()-changedLead.CreatedDate.getTime()))/(1000*60*60); updatedLeads.add(changedLead); } } } } update updatedLeads; }

 

  • August 10, 2011
  • Like
  • 0

I am writing a trigger that should only fire is the created date of the object is after a certain date say august 1, 2011.

 

I am having the hardest time with the syntax of this conditional for my if statement.

 

any help would be greatly appreciated.

 

Thanks,

Phil

  • August 04, 2011
  • Like
  • 0

I have written this trigger and it works great to store the first human generated activty date from the task to the lead record.

 

 

trigger ActivityFirstcontact on Task (after insert) {

List<Lead> updatedLeads= new List<Lead>();
 
    for(Task newTask:Trigger.new){
            if(string.valueOf(NewTask.WhoId).startsWith('00Q') && newTask.Subject != 'Lead Source Details')
            updatedLeads.add(new Lead(Id=newTask.WhoId, First_Contact_Date_Time__c=newTask.CreatedDate));
           }
    
              update updatedLeads;
              
   }

 

I am attempting to modify the code to only write to the field 

 

First_Contact_Date_Time__c

when the field is blank.  How can i update the code to manage this. Anytime I attempt to lookup the lead using the whoid i get errors.

 

Thoughts?

I would like to create a button that changes the record type of a case . 

 

I have tried writing the javascript and scoured the web, but still cannot get it to work.  My code will update other fields if modified but not the recordtypeid.  Any suggestions?

 

{!REQUIRESCRIPT("/soap/ajax/13.0/connection.js")}

var undocase= new sforce.SObject("Case");
undocase.id = "{!Case.Id}";
undocase.RecordType = "01240000000QFLB";

var result = sforce.connection.update([undocase]);

if (result[0].getBoolean("success"))
{
    // Refresh window
    window.location.reload();
}
else
{
    alert("Error saving case");
}

My users have reported that they are unable to open PDFs that are attached to emails coming in via Email2Case.  They are required to download/save the files before viewing.  DOCs will open just fine directly from the SFDC link.  Why is IE treating PDF differently?  I have tested the same thing in Firefox and have no issues viewing PDFs or DOC.

 

Thoughts?

Phil

  • October 06, 2010
  • Like
  • 0

I have a custom object that stores Marketing Activity.  It can be associated with either a Lead or a Contact.  When a lead that has associated object is converted I would like to update the custom record to reflect the new ContactId so that the activity will be preserved in the related list. 

 

Does anybody have any pointers on how to do this?

 

Thanks,

Phil

I am writing a trigger to update a duration field on the lead, after the first sales activity is logged under a lead.

 

I had the code working in the sandbox and deployed to production.  I started getting the dreaded referencing a null object error on this statement.

string.valueOf(newTask.WhoId).startsWith('00Q')

 so i added the null check in front of it.  Now I am no longer getting the error but my code not populating the field on the lead record anymore.  It is almost as if the null check is booting all records and non get to the internal if's.

 

Thoughts?  I have copied my entire code as it exists right now below.

 

Phil

 

trigger ActivityFirstContact on Task (after insert) {

List<Lead> updatedLeads= new List<Lead>(); Datetime d = datetime.newInstance(2011, 8, 10); for(Task newTask:Trigger.new){ boolean notmarketuser = TRUE; if (newTask.Created_By_Role__c.contains('Marketing')) notmarketuser = FALSE; if(newTask.WhoID != NULL){ if(string.valueOf(newTask.WhoId).startsWith('00Q') &&
newTask.Subject != 'Lead Source Details' && notmarketuser) { Lead changedLead = [select id, First_Contact_Number__c, CreatedDate from lead where id=:NewTask.WhoId]; if(changedLead.CreatedDate > d && changedLead.First_Contact_Number__c==NULL) { changedLead.First_Contact_Number__c= decimal.valueof((newTask.CreatedDate.getTime()-changedLead.CreatedDate.getTime()))/(1000*60*60); updatedLeads.add(changedLead); } } } } update updatedLeads; }

 

  • August 10, 2011
  • Like
  • 0

I have written this trigger and it works great to store the first human generated activty date from the task to the lead record.

 

 

trigger ActivityFirstcontact on Task (after insert) {

List<Lead> updatedLeads= new List<Lead>();
 
    for(Task newTask:Trigger.new){
            if(string.valueOf(NewTask.WhoId).startsWith('00Q') && newTask.Subject != 'Lead Source Details')
            updatedLeads.add(new Lead(Id=newTask.WhoId, First_Contact_Date_Time__c=newTask.CreatedDate));
           }
    
              update updatedLeads;
              
   }

 

I am attempting to modify the code to only write to the field 

 

First_Contact_Date_Time__c

when the field is blank.  How can i update the code to manage this. Anytime I attempt to lookup the lead using the whoid i get errors.

 

Thoughts?

I would like to create a button that changes the record type of a case . 

 

I have tried writing the javascript and scoured the web, but still cannot get it to work.  My code will update other fields if modified but not the recordtypeid.  Any suggestions?

 

{!REQUIRESCRIPT("/soap/ajax/13.0/connection.js")}

var undocase= new sforce.SObject("Case");
undocase.id = "{!Case.Id}";
undocase.RecordType = "01240000000QFLB";

var result = sforce.connection.update([undocase]);

if (result[0].getBoolean("success"))
{
    // Refresh window
    window.location.reload();
}
else
{
    alert("Error saving case");
}