• Ron929
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 10
    Replies
2 years experienced Admin and Basic application developer looking for additional work.  Experience developing custom objects, workflow, validation, and approval processes.
  • September 12, 2009
  • Like
  • 0

I am attempting to compare two strings of text.  I am trying to compare the subject of an email template and the subject of a task.  A week ago the subject of the email template was shorter than 70 characters, now it has been changed and is longer.  Here's the code.

 

 

trigger trgOnEOAMEmail on Task (before insert) { String ECOMMsubject = [select subject from emailtemplate where id = '00XR0000000DmjC' LIMIT 1].subject; System.debug('ECOMMsubject : ' + ECOMMsubject ); String EOAMsubject = [select subject from emailtemplate where id = '00XR0000000DmjM' LIMIT 1].subject; System.debug('EOAMsubject : ' + EOAMsubject ); String subEOAMsubject = 'Email: '+EOAMsubject.substring(0,70)+'...'; String subECOMMsubject = 'Email: '+ECOMMsubject.substring(0,70)+'...'; System.debug('subECOMMsubject: '+ subECOMMsubject ); System.debug('subEOAMsubject: '+ subEOAMsubject); FOR (Task act:System.Trigger.new) { System.debug('ACT ID:' + act.Id); System.debug('ACT AT:' + act.Activities_Type__c); System.debug('ACT Type:' + act.Type__c); System.debug('ACT Cat:' + act.Category__c); System.debug('ACT ON:' + act.Original_Need__c); System.debug('ACT Subject:' + act.Subject); System.debug('subECOMMsubject:'+subECOMMsubject); System.debug('subEOAMsubject :'+subEOAMsubject ); if(act.Subject.equals('Email: '+subECOMMsubject+'...') || (act.Subject.equals('Email: '+subEOAMsubject +'...'))) { act.Original_Need__c = 'Account Management'; act.Activities_Type__c = 'Email'; act.Type__c = 'Email'; act.Category__c = 'eComm'; } } }

 

 I've checked the debug logs and act.subject does indeed equal the value of subECOMMsubject or subEOAMsubject.  I can't figure out why this statement doesn't evaluate to true allowing the rest of this trigger to be kicked off.

 

  • March 28, 2009
  • Like
  • 0

I set out originally to create a view all button for the campaign history related list.  Since I'm new to apex and a fairly inexperienced programmer, I am coming here for some help.  We do use person accounts so this may be more difficult than I anticipated.

 

The Campaign History related list is on the account record but still tied to the contact.  So I would first have to lookup the contact.id related to the account.id I am referencing.  I can do this with normal SQL, but since SOQL is just slightly different, I could use some help.  Here is the pseudo code.

 

Thank you in advance. 

 

 

public class CampaignHistoryExt { CampaignMember cm; Contact c; public CampaignMember[] getCampaignHistory() { CampaignMember[] cm = [select Id, Status from CampaignMember cm, Contact c where cm.contactid = c.id]; } }

 

 I figure that I would have to create a visualforce page with this class as an extension in order for this to work correctly.  I'm open to other ideas on how to get this to work if any are out there.  Thanks again.

 

  • March 01, 2009
  • Like
  • 0
I currently have only one web-to-lead campaign working right now.  I wanted to see how others managed leads that may be created by internal users. 

The situation is that we have a service organization and a sales organization and our service organization may create leads for the sales org.  When they create these, they currently don't follow assignment rules.  How are other people managing these, are they just using workflow rules?
  • November 28, 2008
  • Like
  • 0

Hi

 

I am new to salesforce.com, I am working on online tutorial example application. I am woking on Mileage applicatoin sample application.

 

In the Workflow and Approval chapter, After creating the Approval Processes. I am not getting the custom field Approval status, in View Approval Process Detail Page.

 

Can anybody traceout why I am not getting this field for update Filed update. I am able to see only Miles, and Date in custom filed drowdown llist of Initial Submission Action section.

 

 

Regards

MBS

  • August 04, 2009
  • Like
  • 0
Once an account is created, I can go in and change the account owner to a different account.  I am looking to also have this functionality available upon account creation.  Currently, when creating an account, owner is read only and I have no option to change it to a different user.  Is there a setting to allow the changing of an owner at record creation?

I am attempting to compare two strings of text.  I am trying to compare the subject of an email template and the subject of a task.  A week ago the subject of the email template was shorter than 70 characters, now it has been changed and is longer.  Here's the code.

 

 

trigger trgOnEOAMEmail on Task (before insert) { String ECOMMsubject = [select subject from emailtemplate where id = '00XR0000000DmjC' LIMIT 1].subject; System.debug('ECOMMsubject : ' + ECOMMsubject ); String EOAMsubject = [select subject from emailtemplate where id = '00XR0000000DmjM' LIMIT 1].subject; System.debug('EOAMsubject : ' + EOAMsubject ); String subEOAMsubject = 'Email: '+EOAMsubject.substring(0,70)+'...'; String subECOMMsubject = 'Email: '+ECOMMsubject.substring(0,70)+'...'; System.debug('subECOMMsubject: '+ subECOMMsubject ); System.debug('subEOAMsubject: '+ subEOAMsubject); FOR (Task act:System.Trigger.new) { System.debug('ACT ID:' + act.Id); System.debug('ACT AT:' + act.Activities_Type__c); System.debug('ACT Type:' + act.Type__c); System.debug('ACT Cat:' + act.Category__c); System.debug('ACT ON:' + act.Original_Need__c); System.debug('ACT Subject:' + act.Subject); System.debug('subECOMMsubject:'+subECOMMsubject); System.debug('subEOAMsubject :'+subEOAMsubject ); if(act.Subject.equals('Email: '+subECOMMsubject+'...') || (act.Subject.equals('Email: '+subEOAMsubject +'...'))) { act.Original_Need__c = 'Account Management'; act.Activities_Type__c = 'Email'; act.Type__c = 'Email'; act.Category__c = 'eComm'; } } }

 

 I've checked the debug logs and act.subject does indeed equal the value of subECOMMsubject or subEOAMsubject.  I can't figure out why this statement doesn't evaluate to true allowing the rest of this trigger to be kicked off.

 

  • March 28, 2009
  • Like
  • 0

I am very new to writing triggers. I've been reading the cookbook and scouring the community for similar newbie posts. I know this is a simple concept, but I'm unsure of how to proceed. Any guidance would be appreciated.

What I Want to Do: Populate a custom field on the Task object with a custom picklist value on the User object. (If a lookup to the user object was possible, this would solve all my problems!)

My Method: So far, this is what I've got. Pretty pathetic. 

I created a class like this:

 

public class DetermineUserRegion { // This class should automatically set the Region field to the assigned user's region User currentUserRegion = [Select region__c From User Where User.Id = Task.OwnerId ]; Task.User_Region__c = currentUserRegion; }

And then I was going to call that from the trigger. 

But, no success as of yet. Perhaps that isn't even the best method.

Any advice for a newbie?

 

Is there a way to automatically change the owner of a lead after a set period of time? We're trying to set SFDC so that after 90 days, our leads no longer have an owner, but remain in the system.

 

Is this possible?

 

Any help would be greatly appreicated.

  • February 05, 2009
  • Like
  • 0
I currently have only one web-to-lead campaign working right now.  I wanted to see how others managed leads that may be created by internal users. 

The situation is that we have a service organization and a sales organization and our service organization may create leads for the sales org.  When they create these, they currently don't follow assignment rules.  How are other people managing these, are they just using workflow rules?
  • November 28, 2008
  • Like
  • 0
Hey,
How do you do this: I need to get information (three fields) from my Opportunity page to Case page (with those very same fields). Is it possible to some how take care of this kind of task?

For example when converting a Lead into Account and Opportunity, the fields are autofilled by the information from that Lead. Nice and easy! I would like to do something similar with Opportunity --> Case, and be able to choose which fields are needed.

Is this a piece of cake thing or what? Help needed!

:smileyindifferent:

Yours,
TigerPower


Currently, when you press 'View All' it replaces the contact record. I then have to press cancel and 'Log a call' to add a new note in. Should I want to refer back to the previous activity history, there is no easy way to do this.

So, I'm thinking that, if we make the 'View All' (and preferably 'Log a call') pop open in a new window, this would enable the user to flick easily between them.

Can anyone help?