• DoubleA
  • NEWBIE
  • 0 Points
  • Member since 2009

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

Hi All,

 

I was hoping I can get an idea on how this could be achieved.  I wanted to update the date field on a bunch of Leads after they are included on a Mass Email.

 

 

Has anyone done this, and what action would fire trigger?  Sounds straight forward but i'm just unsure.

 

Thanks for any help.

Hi,

This question is on behalf of a colleague of mine who brought up a question, however i'm unsure whether this would be apex development related.

 

Basically the problem is that a school requires certificates to be printed for it's students "Contacts" , so I suggested saving the certificate as a template and use the tags to populate the name which is fine.  However, the client would like a way to do this from the Student/Contact record.  Possibly a button to click that would allow them to Print the document. 

 

Has anyone done anything similar to this and could shed some light on the subject.

 

Much thanks

Hi, I had a questions regarding editting code and best practice.

 

If I wanted to go back and update and old triggers / code created by others or myself from another computer, how would I access it from the production account?  Would I have to download the trigger code and create a new project or is there a way to update the existing production account trigger?  Will I have to re-test the code with new test classes or can the old one be downloaded from the server?  (I use eclipse)

 

Thanks for any tips!

 

Hi, I'm receiving the following deployment log showing run failure.  Can anyone help in figuring out why it is failing.  

 

# Test Results:

Run Failures:
  Test_Contacts.myUnitTest System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, UpdateAccount: execution of AfterInsert

caused by: System.ListException: Duplicate id in list: 0018000000OI2VcAAL

Trigger.UpdateAccount: line 44, column 9

Hello,

 

I know it seems like a dumb question but I'm trying to familiarize myself with testing apex code with apex language.  

 

I am unsure when to use system.assertequals(x,y), system.assert(condition) and system.assertnotequals(x,y) and I have noticed it being used quite a bit.  I've looked at the user guide and and this link http://wiki.developerforce.com/index.php/An_Introduction_to_Apex_Code_Test_Methods, but still require more of a plain english explanation on when and why these methods are used.

 

Can anyone help me on this.

 

Much thanks!

Hi All, Was wondering if anyone knows of any prepackaged XML Feed parser which can be used to parse values out of an XML feed and send into Salesforce.com.

 

Basically what it is for is to capture values submitted from a form from an external website a company is using to generate leads from and they cannot add tags and changes via SF's web to lead form, so they only way to do is is to capture the info from the XML feeds.

 

Any help would be great!

Hi I recently created my first trigger with the great help from one of hte users on the group, however I realized I cannot deploy this trigger to a production account without a Test method testing over 75% of the code (below).  Unfortunately I have never test code and would like some help in doing this since I cannot deploy to production without doing so.

 

trigger UpdateContactsAccount on Task (after insert, after update) { SET<ID> setContactID = new SET<ID>(); string contactID = ''; for(Task t : Trigger.New){ if(t.whoid!=null && t.whatid ==null){ contactID = t.Whoid; if(contactID.startsWith('003')){ setContactID.add(contactID); } } } LIST<Contact> recordsToUpdate = [Select Id, AccountID, Account.Description, Account.Last_Call_Date__c, Account.Last_Visit_Date__c From Contact Where Id IN : setContactID]; List<Account> accountsToUpdate = new List <Account>(); for(Task t : Trigger.New){ for(Contact c : recordsToUpdate){ if(t.subject.startswith('Call')|| t.subject.startswith('call')){ c.Account.Last_Call_Date__c = t.activitydate; Account a = new Account(Id=c.Account.Id, Last_Call_Date__c=c.Account.Last_Call_Date__c); accountsToUpdate.add(a) ; } if(t.subject.startswith('Visit') || t.subject.startswith('visit')){ c.Account.Last_Visit_Date__c = t.activitydate; Account a = new Account(Id=c.Account.Id, Last_Visit_Date__c=c.Account.Last_Visit_Date__c); accountsToUpdate.add(a) ; } } } if(accountsToUpdate.size() > 0){ database.update(accountsToUpdate, false); } }

 

I had a question regarding apex syntax:

 

I have a trigger that fires on an activity (insert).  I have a field on an Account record that needs updated once the trigger executes.

 

I'm stuck on the part where if I create this task for a contact, how do I update the field on this contact's associated Account record?  I cannot translate this into syntax.


Can anyone help on this?

Thanks

Hello,

 

I know it seems like a dumb question but I'm trying to familiarize myself with testing apex code with apex language.  

 

I am unsure when to use system.assertequals(x,y), system.assert(condition) and system.assertnotequals(x,y) and I have noticed it being used quite a bit.  I've looked at the user guide and and this link http://wiki.developerforce.com/index.php/An_Introduction_to_Apex_Code_Test_Methods, but still require more of a plain english explanation on when and why these methods are used.

 

Can anyone help me on this.

 

Much thanks!

Hi, I had a questions regarding editting code and best practice.

 

If I wanted to go back and update and old triggers / code created by others or myself from another computer, how would I access it from the production account?  Would I have to download the trigger code and create a new project or is there a way to update the existing production account trigger?  Will I have to re-test the code with new test classes or can the old one be downloaded from the server?  (I use eclipse)

 

Thanks for any tips!

 

Hi, I'm receiving the following deployment log showing run failure.  Can anyone help in figuring out why it is failing.  

 

# Test Results:

Run Failures:
  Test_Contacts.myUnitTest System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, UpdateAccount: execution of AfterInsert

caused by: System.ListException: Duplicate id in list: 0018000000OI2VcAAL

Trigger.UpdateAccount: line 44, column 9

Hello,

 

I know it seems like a dumb question but I'm trying to familiarize myself with testing apex code with apex language.  

 

I am unsure when to use system.assertequals(x,y), system.assert(condition) and system.assertnotequals(x,y) and I have noticed it being used quite a bit.  I've looked at the user guide and and this link http://wiki.developerforce.com/index.php/An_Introduction_to_Apex_Code_Test_Methods, but still require more of a plain english explanation on when and why these methods are used.

 

Can anyone help me on this.

 

Much thanks!

Hi I recently created my first trigger with the great help from one of hte users on the group, however I realized I cannot deploy this trigger to a production account without a Test method testing over 75% of the code (below).  Unfortunately I have never test code and would like some help in doing this since I cannot deploy to production without doing so.

 

trigger UpdateContactsAccount on Task (after insert, after update) { SET<ID> setContactID = new SET<ID>(); string contactID = ''; for(Task t : Trigger.New){ if(t.whoid!=null && t.whatid ==null){ contactID = t.Whoid; if(contactID.startsWith('003')){ setContactID.add(contactID); } } } LIST<Contact> recordsToUpdate = [Select Id, AccountID, Account.Description, Account.Last_Call_Date__c, Account.Last_Visit_Date__c From Contact Where Id IN : setContactID]; List<Account> accountsToUpdate = new List <Account>(); for(Task t : Trigger.New){ for(Contact c : recordsToUpdate){ if(t.subject.startswith('Call')|| t.subject.startswith('call')){ c.Account.Last_Call_Date__c = t.activitydate; Account a = new Account(Id=c.Account.Id, Last_Call_Date__c=c.Account.Last_Call_Date__c); accountsToUpdate.add(a) ; } if(t.subject.startswith('Visit') || t.subject.startswith('visit')){ c.Account.Last_Visit_Date__c = t.activitydate; Account a = new Account(Id=c.Account.Id, Last_Visit_Date__c=c.Account.Last_Visit_Date__c); accountsToUpdate.add(a) ; } } } if(accountsToUpdate.size() > 0){ database.update(accountsToUpdate, false); } }

 

I had a question regarding apex syntax:

 

I have a trigger that fires on an activity (insert).  I have a field on an Account record that needs updated once the trigger executes.

 

I'm stuck on the part where if I create this task for a contact, how do I update the field on this contact's associated Account record?  I cannot translate this into syntax.


Can anyone help on this?

Thanks