• sfdc.geeks
  • NEWBIE
  • 0 Points
  • Member since 2012

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

We are looking for a Salesforce freelancer that can provide salesforce consultation, support in developing salesforce workflows, help create custom moduls and possibly has some knowhow in drupal which would be an advantage but not a must. We require someone that has an in-depth knowledge of salesforce and knows about the different appexchange products and tools available. As social media has become a key factor in businesses, we also need consulting on how we can make salesforce become more social in the type of business we are working in and how salesforce users within the company need to use Salesforce the right way.

 

At last it is important to say that we are mainly looking for a freelancer.

 

Please be sure to leave your email and phone number.

 

 

  • October 31, 2012
  • Like
  • 0

I am really knew to all this and having trouble deploying a trigger that will udpate a field in a contact when the status of an activity changes.  At this point I have the trigger working just find but the class I created for testing fails and I have no idea why.  Thank you for taking the time to thelp!  

 

The message I get when I run the class is: 

System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, Update_Last_VM_Left: execution of AfterInsert caused by: System.DmlException: Update failed. First exception on row 0; first error: MISSING_ARGUMENT, Id not specified in an update call: [] Trigger.Update_Last_VM_Left: line 7, column 1: []

 

Stack Trace:

Class.TaskTestMethod.TestTasktrigger: line 12, column 1

 

 

And here's my code:

 

Trigger:

1
2
3
4
5
6
7
8
9
trigger Update_Last_VM_Left on Task (after insert, after update)
{
  Task ts= Trigger.new[0];
  if(ts.Status == 'VM Left'){
      Contact contactToUpdate = new Contact(id=ts.WhoID);
      contactToUpdate.Last_VM_Left__c = date.today();
      update contactToUpdate;
  } 
}

 

Class:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
@isTest
private class TaskTestMethod{
static testMethod void TestTasktrigger()
    {
            Task[] CreateTask = new Task[]{};
            Contact[] CreateContact = new Contact[]{};
            for(Integer x=0; x<100;x++){
            Task ts = new Task(Subject='Apex Test',Status='VM Left');
            CreateTask.add(ts);    
            }  
        Test.startTest();
        insert CreateTask;
        Test.stopTest(); 
    }
}

 

  • September 29, 2012
  • Like
  • 0