+ Start a Discussion
PranavLPranavL 

Getting message of INVALID_FIELD_FOR_INSERT_UPDATE, cannot specify Id in an insert call

Hello,

 

I am getting the above failure message in my test code when I am run the tests.

 

The problem area is the submit() function in the test code. When I call the function from the controller it gives me the failure message.

 

System.DmlException: Insert failed. First exception on row 0 with id 001Z0000002ZmiEIAS; first error: INVALID_FIELD_FOR_INSERT_UPDATE, cannot specify Id in an insert call: [Id]

 

TEST CODE IS AS FOLLOWS:

@isTest
public class TSWPageControllerTest {
static testMethod void validateSubmit() {
TSWPagecontroller twsc2 = new TSWPagecontroller();
Account acc123 = new Account();
acc123.Name = 'POLDWE';
acc123.Description ='Hello Description';
acc123.Phone = '4211234552';
insert acc123 ;
twsc2.setAccount(acc123);


//Contact con = [SELECT Id, Name from Contact where LastName <> NULL limit 1 ] ;

Contact con123 = new Contact();
con123.FirstName = '12hiuhi3';
con123.LastName = 'gyuguy';
con123.Email='pranavlal@nowitbhjbjmatters.com';
insert con123 ;
twsc2.setContact(con123);





Event__c e5 = new Event__c(
          Name = 'Test TSW Event123456',
          Type_of_Event__c = 'Interview' ,
          Event_Description__c ='Great Event',
          Is_the_event_open_to_all__c = 'Free to Public',
          Who_do_you_expect_to_come_to_this_event__c = 'Pranav',
          Organization__c = acc123.Id ,
          Contact__c = con123.Id ,
          Expected_Attendance__c = 433,
          What_are_the_alternate_dates_possible__c = '32123'
          
         );
         
        insert e5;
        twsc2.setEvent(e5) ;

Trip__c t5 = new Trip__c(
         Name = 'Test Trip 12ac1234',
         Main_Event__c = e5.id 
         );
         insert t5;
         twsc2.setTrip(t5);
         
        
PageReference Submit= twsc2.Submit();


}
     
     
     
     static testMethod void validateGetters() {
         TSWPagecontroller twsc = new TSWPagecontroller();
         
         twsc.getTrip();
         twsc.getEvent();
         twsc.getSession();
         twsc.getAccount();
         twsc.getContact();
         twsc.getSessionList();
         
         
         
         twsc.step1();
         twsc.step2();
         //twsc.step3();
         twsc.step4();
         twsc.step5();
         twsc.step6();
         
         twsc.addsession();
         twsc.deletecon();
        
         
     }

 

 

CONTROLLER CODE IS AS FOLLOWS:

 

public class TSWPageController {

    public TSWPageController(ApexPages.StandardController controller) {

    }

    Trip__c trip ;
    Event__c event ;
    Event__c event1 ;
    Session__c session ; 
    Message_Template__c message ;
    Media__c media ;
    Account account ;
    Contact contact ;

public String dcid{get;set;} // commandlink delete property
public boolean billcity{get;set;}
    
public List<SelectOption> myList {get; set;}
    public boolean showSection {get; set;}
//    public boolean showContact {get; set;}
    public String SelectedVal {get; set;}
    
list<Session__c> lstacc1 = new list<Session__c>();
    
    public TSWPageController()
    {
        
        
    }
    public Trip__c getTrip(){
        if(trip== null) trip = new Trip__c();
        return trip;
            
    }
    public void setTrip(Trip__c t) { trip = t; }
    
    
     public Event__c getEvent(){
        if(event==null) event = new Event__c();
        return event;
    
    }
    
    public void setEvent(Event__c e) {event = e; }
    public Session__c getSession(){
        if(session== null) session = new Session__c(
        Date_of_Session__c = event.Event_Start_Date__c
        );
        return session;
    }
    
    public void setSession(Session__c s) {session = s ; }
    public Account getAccount(){
        if(account== null) account = new Account();
        return account;
        
    }    
    public void setAccount(Account a) { account = a; }
    public Contact getContact(){
        if(contact== null) contact = new Contact();
        return contact;
    
    }
    public void setContact(Contact c) { contact = c; }
        
       public PageReference step1() {
          return Page.Introduction;
       }
       public PageReference step2() {
                         
          return Page.TripAndContactInformation;
       }
       public PageReference step3() {
       if(trip.Is_Event_and_Organization_address_same__c == true)
       {
       billcity = false ;
       event.Event_City__c = account.billingcity;
       event.Event_State__c = account.billingstate ;
       event.Event_Country__c = account.billingcountry ;
       event.Venue_Name__c = account.name ;
       event.Event_Zip__c = account.BillingPostalCode;
       event.Event_Address__c = account.billingStreet ;
       
       }
       if(trip.Is_Event_and_Organization_address_same__c == false)
       {
       billcity = true ;
       event.Event_City__c = account.billingcity;
       event.Event_State__c = account.billingstate ;
       event.Event_Country__c = account.billingcountry ;
       }
          return Page.EventInformation;
       }
       public PageReference step4() {
       
      event.Trip__c = trip.Id ;
      event.Organization__c = account.Id ;
      event.Contact__c = contact.Id ;
      event.Event_Status__c = 'Incomplete' ;
      
      upsert event ;
      return Page.AddSessions;
       }
   public List<Session__c> getSessionList()
  {
      if(session <> NULL ){
          
     return [select Name, Start_Time__c,Date_of_Session__c,Length_of_session_in_minutes__c,Type_of_Session__c from Session__c where Event_Name__c =: event.id ];
     
     }
     else
     {return NULL ;}
  }
       public PageReference AddSession() {
        
        Session__c se= new Session__c();
        se.Event_Name__c = event.id ;
        se.Name = session.Name;
        se.Date_of_Session__c = session.Date_of_Session__c ;
        se.Type_of_Session__c = session.Type_of_Session__c ;
        se.Start_Time__c = session.Start_Time__c ;
        se.Room_Building__c = session.Room_Building__c ;
        se.Audience_Size__c = session.Audience_Size__c ;
        se.Length_of_session_in_minutes__c = session.Length_of_session_in_minutes__c ;
        se.How_long_do_you_want_Shane_to_talk__c = session.How_long_do_you_want_Shane_to_talk__c ;
        se.What_do_you_want_Shane_to_talk_about__c = session.What_do_you_want_Shane_to_talk_about__c ;
        insert se;
        return NULL;
       
       }     
   public pagereference deleteCon() {
        lstacc1 =[Select Id,Name from Session__c where id=:dcid];
        delete lstacc1;
        return Page.AddSessions; 
    }
          
         
       public PageReference step5() {
          return Page.Confirmation;
       }
       
       public PageReference step6() {
          return Page.ThankYou;
       }
       
       
       public PageReference submit() {
      account.Phone = contact.Phone ;
      insert account;
      contact.AccountId = account.id;
      insert contact;
      trip.Name ='abc' ;
      trip.Stage__c='Requested';
      trip.Main_Event__c = event.id ;
      insert trip;

     
      //Not inserting event here but after adding Event Information field
      event.Trip__c = trip.Id ;
      event.Organization__c = account.Id ;
      event.Contact__c = contact.Id ;
      event.Main_Event__c = true ;
      event.Event_Status__c = 'Request Submitted' ;
      upsert event ; 
      
  upsert trip;
 
       return Page.ThankYou ;      
       
   
    
}
steve456steve456

could u post d screen shot of d debug logs

PranavLPranavL

Hi,

 

Following are the logs:

 


10:33:19.642 (2642692000)|SOQL_EXECUTE_END|[6]|Rows:1
10:33:19.643 (2643947000)|SOQL_EXECUTE_BEGIN|[18]|Aggregations:0|SELECT id,name FROM account WHERE IsDeleted=false AND PDS__Customer_ListID__c !='' AND name =:acct.name AND Id!=:acct.id
10:33:19.648 (2648186000)|SOQL_EXECUTE_END|[18]|Rows:0
10:33:19.648 (2648356000)|DML_END|[330]
10:33:19.650 (2650925000)|ENTERING_MANAGED_PKG|npe5
10:33:19.652 (2652571000)|CODE_UNIT_STARTED|[EXTERNAL]|Validation:Contact:new
10:33:19.652 (2652583000)|VALIDATION_RULE|03dA0000000Z2Sz|Contact_Preferred_Email
10:33:19.652 (2652925000)|VALIDATION_FORMULA|AND(
ISPICKVAL( npe01__Preferred_Email__c ,""),
OR(
LEN(npe01__AlternateEmail__c  )>0,
LEN(npe01__WorkEmail__c )>0,
LEN(npe01__HomeEmail__c  )>0
)
)|npe01__WorkEmail__c=null , npe01__AlternateEmail__c=null , npe01__HomeEmail__c=null , npe01__Preferred_Email__c=null
10:33:19.652 (2652941000)|VALIDATION_PASS
10:33:19.652 (2652945000)|VALIDATION_RULE|03dA0000000Z2T0|Contact_Preferred_Phone
10:33:19.653 (2653232000)|VALIDATION_FORMULA|AND(
 ISPICKVAL(npe01__PreferredPhone__c ,""),
OR(
 LEN(MobilePhone)>0,
 LEN( npe01__WorkPhone__c)>0,
 LEN( OtherPhone )>0
)
)|npe01__WorkPhone__c=null , OtherPhone=null , npe01__PreferredPhone__c=null , MobilePhone=null
10:33:19.653 (2653247000)|VALIDATION_PASS
10:33:19.653 (2653251000)|CODE_UNIT_FINISHED|Validation:Contact:new
10:33:19.699 (2699603000)|ENTERING_MANAGED_PKG|npo02
10:33:19.701 (2701298000)|ENTERING_MANAGED_PKG|npe01
10:33:19.701 (2701433000)|SOQL_EXECUTE_BEGIN|[42]|Aggregations:0|select id,SystemAccountProcessor__c,Private__c,AccountId,Account.npe01__SYSTEMIsIndividual__c,Account.Name,firstname, lastname from Contact where Id IN :trigger.New
10:33:19.707 (2707557000)|SOQL_EXECUTE_END|[42]|Rows:1
10:33:19.707 (2707810000)|SOQL_EXECUTE_BEGIN|[58]|Aggregations:0|select Id,npe01__One2OneContact__c from Account where Id IN :contactAccountIds
10:33:19.709 (2709888000)|SOQL_EXECUTE_END|[58]|Rows:1
10:33:19.710 (2710441000)|DML_BEGIN|[219]|Op:Update|Type:Account|Rows:1
10:33:19.717 (2717110000)|ENTERING_MANAGED_PKG|PDS
10:33:19.736 (2736530000)|DML_END|[219]
10:33:19.738 (2738312000)|ENTERING_MANAGED_PKG|npe5
10:33:19.738 (2738609000)|SOQL_EXECUTE_BEGIN|[104]|Aggregations:0|Select Id, Name from Account where Id in :accountIds
10:33:19.740 (2740484000)|SOQL_EXECUTE_END|[104]|Rows:1
10:33:19.741 (2741413000)|CODE_UNIT_STARTED|[EXTERNAL]|Workflow:Contact
10:33:19.752 (2752946000)|WF_RULE_EVAL_BEGIN|Assignment
10:33:19.752 (2752971000)|WF_RULE_EVAL_BEGIN|Response
10:33:19.752 (2752982000)|WF_RULE_EVAL_BEGIN|Workflow
10:33:19.753 (2753029000)|WF_CRITERIA_BEGIN|[Contact: 12hiuhi3 gyuguy 003Z0000002RIqn]|Contact.PhoneChanged_Home|01QA0000000Yzgu|ON_ALL_CHANGES
10:33:19.753 (2753225000)|WF_FORMULA|Formula:AND(      ISPICKVAL( npe01__PreferredPhone__c ,"Home"),      OR(           AND(                ISNEW(),                LEN(Phone)>0           ),           ISCHANGED( Phone )      ) )|Values:Phone=null, npe01__PreferredPhone__c=null
10:33:19.753 (2753243000)|WF_CRITERIA_END|false
10:33:19.753 (2753267000)|WF_CRITERIA_BEGIN|[Contact: 12hiuhi3 gyuguy 003Z0000002RIqn]|Contact.EmailChanged_Work|01QA0000000Yzgt|ON_ALL_CHANGES
10:33:19.753 (2753404000)|WF_FORMULA|Formula:AND(      ISPICKVAL( npe01__Preferred_Email__c ,"Work"),      OR(           AND(                ISNEW(),                LEN(Email)>0           ),           ISCHANGED( Email )      ) )|Values:Email=pranavlal@nowitbhjbjmatters.com, npe01__Preferred_Email__c=null
10:33:19.753 (2753418000)|WF_CRITERIA_END|false
10:33:19.753 (2753440000)|WF_CRITERIA_BEGIN|[Contact: 12hiuhi3 gyuguy 003Z0000002RIqn]|Contact.PhoneChanged_Other|01QA0000000Yzgs|ON_ALL_CHANGES
10:33:19.753 (2753558000)|WF_FORMULA|Formula:AND(      ISPICKVAL( npe01__PreferredPhone__c ,"Other"),      OR(           AND(                ISNEW(),                LEN(Phone)>0           ),           ISCHANGED( Phone )      ) )|Values:Phone=null, npe01__PreferredPhone__c=null
10:33:19.753 (2753572000)|WF_CRITERIA_END|false
10:33:19.753 (2753594000)|WF_CRITERIA_BEGIN|[Contact: 12hiuhi3 gyuguy 003Z0000002RIqn]|Contact.PhoneChanged_Mobile|01QA0000000Yzgr|ON_ALL_CHANGES
10:33:19.753 (2753707000)|WF_FORMULA|Formula:AND(      ISPICKVAL( npe01__PreferredPhone__c ,"Mobile"),      OR(           AND(                ISNEW(),                LEN(Phone)>0           ),           ISCHANGED( Phone )      ) )|Values:Phone=null, npe01__PreferredPhone__c=null
10:33:19.753 (2753720000)|WF_CRITERIA_END|false
10:33:19.753 (2753740000)|WF_CRITERIA_BEGIN|[Contact: 12hiuhi3 gyuguy 003Z0000002RIqn]|Contact.PhoneChanged_Work|01QA0000000Yzgq|ON_ALL_CHANGES
10:33:19.753 (2753852000)|WF_FORMULA|Formula:AND(      ISPICKVAL( npe01__PreferredPhone__c ,"Work"),      OR(           AND(                ISNEW(),                LEN(Phone)>0           ),           ISCHANGED( Phone )      ) )|Values:Phone=null, npe01__PreferredPhone__c=null
10:33:19.753 (2753867000)|WF_CRITERIA_END|false
10:33:19.753 (2753888000)|WF_CRITERIA_BEGIN|[Contact: 12hiuhi3 gyuguy 003Z0000002RIqn]|Contact.EmailChanged_Alternate|01QA0000000Yzgp|ON_ALL_CHANGES
10:33:19.754 (2754002000)|WF_FORMULA|Formula:AND(      ISPICKVAL( npe01__Preferred_Email__c ,"Alternate"),      OR(           AND(                ISNEW(),                LEN(Email)>0           ),           ISCHANGED( Email )      ) )|Values:Email=pranavlal@nowitbhjbjmatters.com, npe01__Preferred_Email__c=null
10:33:19.754 (2754017000)|WF_CRITERIA_END|false
10:33:19.754 (2754038000)|WF_CRITERIA_BEGIN|[Contact: 12hiuhi3 gyuguy 003Z0000002RIqn]|Contact.EmailChanged_Personal|01QA0000000Yzgo|ON_ALL_CHANGES
10:33:19.754 (2754164000)|WF_FORMULA|Formula:AND(      ISPICKVAL( npe01__Preferred_Email__c ,"Personal"),      OR(           AND(                ISNEW(),                LEN(Email)>0           ),           ISCHANGED( Email )      ) )|Values:Email=pranavlal@nowitbhjbjmatters.com, npe01__Preferred_Email__c=null
10:33:19.754 (2754179000)|WF_CRITERIA_END|false
10:33:19.754 (2754201000)|WF_CRITERIA_BEGIN|[Contact: 12hiuhi3 gyuguy 003Z0000002RIqn]|Contact.Preferred_Email__c|01QA0000000Yzgn|ON_ALL_CHANGES
10:33:19.754 (2754404000)|WF_FORMULA|Formula:OR( LEN(Email)=0, ISCHANGED(npe01__Preferred_Email__c) , ISCHANGED(npe01__WorkEmail__c) , ISCHANGED(npe01__HomeEmail__c) , ISCHANGED(npe01__AlternateEmail__c)  )|Values:npe01__WorkEmail__c=null, npe01__AlternateEmail__c=null, npe01__HomeEmail__c=null, Email=pranavlal@nowitbhjbjmatters.com, npe01__Preferred_Email__c=null
10:33:19.754 (2754419000)|WF_CRITERIA_END|false
10:33:19.754 (2754441000)|WF_CRITERIA_BEGIN|[Contact: 12hiuhi3 gyuguy 003Z0000002RIqn]|Contact.Preferred_Phone__c|01QA0000000Yzgm|ON_ALL_CHANGES
10:33:19.754 (2754607000)|WF_FORMULA|Formula:OR(  LEN(Phone)=0, ISCHANGED(npe01__PreferredPhone__c) ,  ISCHANGED(npe01__WorkPhone__c) ,  ISCHANGED(HomePhone) ,  ISCHANGED(MobilePhone) , ISCHANGED(OtherPhone)  )|Values:npe01__WorkPhone__c=null, OtherPhone=null, Phone=null, npe01__PreferredPhone__c=null, MobilePhone=null, HomePhone=null
10:33:19.754 (2754623000)|WF_CRITERIA_END|true
10:33:19.754 (2754655000)|WF_CRITERIA_BEGIN|[Contact: 12hiuhi3 gyuguy 003Z0000002RIqn]|Contact.Preferred_Phone__c WithHousehold|01QA0000000Yzgl|ON_CREATE_ONLY
10:33:19.754 (2754675000)|WF_FORMULA|Formula:1=2|Values:
10:33:19.754 (2754682000)|WF_CRITERIA_END|false
10:33:19.754 (2754697000)|WF_CRITERIA_BEGIN|[Contact: 12hiuhi3 gyuguy 003Z0000002RIqn]|Email only: Paste to Work|01QA0000000Yzgk|ON_CREATE_OR_TRIGGERING_UPDATE
10:33:19.754 (2754750000)|WF_RULE_FILTER|[Contact : Email not equal to null]
AND [Contact : Preferred Email equals null]
AND [Contact : Personal Email equals null]
AND [Contact : Alternate Email equals null]
AND [Contact : Work Email equals null]
10:33:19.754 (2754768000)|WF_RULE_EVAL_VALUE|pranavlal@nowitbhjbjmatters.com
10:33:19.754 (2754776000)|WF_RULE_EVAL_VALUE|null
10:33:19.754 (2754783000)|WF_RULE_EVAL_VALUE|null
10:33:19.754 (2754788000)|WF_RULE_EVAL_VALUE|null
10:33:19.754 (2754793000)|WF_RULE_EVAL_VALUE|null
10:33:19.754 (2754798000)|WF_CRITERIA_END|true
10:33:19.754 (2754822000)|WF_CRITERIA_BEGIN|[Contact: 12hiuhi3 gyuguy 003Z0000002RIqn]|Phone only: Paste to Work|01QA0000000Yzgj|ON_CREATE_OR_TRIGGERING_UPDATE
10:33:19.754 (2754940000)|WF_RULE_FILTER|[Contact : Phone not equal to null] AND
 [Contact : Preferred Phone equals null] AND
 [Contact : Work Phone equals null] AND
 [Contact : Mobile Phone equals null] AND
 [Contact : Home Phone equals null] AND
 [Contact : Other Phone equals null]
10:33:19.755 (2755089000)|WF_RULE_EVAL_VALUE|null
10:33:19.755 (2755104000)|WF_CRITERIA_END|false
10:33:19.755 (2755126000)|WF_SPOOL_ACTION_BEGIN|Workflow
10:33:19.755 (2755375000)|WF_FIELD_UPDATE|[Contact: 12hiuhi3 gyuguy 003Z0000002RIqn]|Field:Contact: Preferred Email|Value:Work|Id=04YA0000000I1hK|CurrentRule:Email only: Paste to Work (Id=01QA0000000Yzgk)
10:33:19.755 (2755513000)|WF_FIELD_UPDATE|[Contact: 12hiuhi3 gyuguy 003Z0000002RIqn]|Field:Contact: Work Email|Value:pranavlal@nowitbhjbjmatters.com|Id=04YA0000000I1hL|CurrentRule:Email only: Paste to Work (Id=01QA0000000Yzgk)
10:33:19.755 (2755552000)|WF_ACTION| Field Update: 3;
10:33:19.755 (2755566000)|WF_RULE_EVAL_BEGIN|Escalation
10:33:19.755 (2755573000)|WF_RULE_EVAL_END
10:33:19.758 (2758802000)|ENTERING_MANAGED_PKG|npe01
10:33:19.759 (2759109000)|SOQL_EXECUTE_BEGIN|[58]|Aggregations:0|select Id,npe01__One2OneContact__c from Account where Id IN :contactAccountIds
10:33:19.761 (2761235000)|SOQL_EXECUTE_END|[58]|Rows:1
10:33:19.762 (2762855000)|ENTERING_MANAGED_PKG|npe5
10:33:19.778 (2778907000)|ENTERING_MANAGED_PKG|npo02
10:33:19.780 (2780646000)|ENTERING_MANAGED_PKG|npe01
10:33:19.780 (2780851000)|SOQL_EXECUTE_BEGIN|[48]|Aggregations:0|select id,SystemAccountProcessor__c,Private__c,AccountId,Account.npe01__SYSTEMIsIndividual__c,Organization_Type__c,Account.Name,firstname, lastname,MailingStreet, MailingCity, MailingState, MailingPostalCode, MailingCountry, OtherStreet, OtherCity, OtherState, OtherPostalCode, OtherCountry, Phone, Fax from Contact where Id IN :trigger.New
10:33:19.796 (2796073000)|SOQL_EXECUTE_END|[48]|Rows:1
10:33:19.796 (2796339000)|SOQL_EXECUTE_BEGIN|[58]|Aggregations:0|select Id,npe01__One2OneContact__c from Account where Id IN :contactAccountIds
10:33:19.798 (2798568000)|SOQL_EXECUTE_END|[58]|Rows:1
10:33:19.800 (2800636000)|ENTERING_MANAGED_PKG|npe5
10:33:19.801 (2801631000)|WF_ACTIONS_END| Field Update: 3;
10:33:19.801 (2801641000)|CODE_UNIT_FINISHED|Workflow:Contact
10:33:19.801 (2801722000)|DML_END|[271]
10:33:19.801 (2801785000)|METHOD_ENTRY|[272]|01pZ00000008Yzi|TSWPageController.setContact(SOBJECT:Contact)
10:33:19.801 (2801840000)|METHOD_EXIT|[272]|01pZ00000008Yzi|TSWPageController.setContact(SOBJECT:Contact)
10:33:19.801 (2801920000)|DML_BEGIN|[290]|Op:Insert|Type:Event__c|Rows:1
10:33:19.830 (2830811000)|CODE_UNIT_STARTED|[EXTERNAL]|Workflow:01IZ00000004M4T
10:33:19.838 (2838576000)|WF_RULE_EVAL_BEGIN|Assignment
10:33:19.838 (2838600000)|WF_RULE_EVAL_BEGIN|Response
10:33:19.838 (2838611000)|WF_RULE_EVAL_BEGIN|Workflow
10:33:19.838 (2838636000)|WF_CRITERIA_BEGIN|[Event: Test TSW Event123456 a07Z0000000JY5L]|Send Email after Comments received|01QZ0000000Cjji|ON_ALL_CHANGES
10:33:19.838 (2838667000)|WF_RULE_FILTER|[Event : Created Date not equal to null]
10:33:19.838 (2838687000)|WF_RULE_EVAL_VALUE|2011-12-06 18:33:20
10:33:19.838 (2838694000)|WF_CRITERIA_END|true
10:33:19.838 (2838721000)|WF_SPOOL_ACTION_BEGIN|Workflow
10:33:19.838 (2838740000)|WF_RULE_INVOCATION|[Event: Test TSW Event123456 a07Z0000000JY5L]
10:33:19.838 (2838758000)|WF_EMAIL_ALERT|Id=01WZ0000000CcMU|CurrentRule:Send Email after Comments received (Id=01QZ0000000Cjji)
10:33:19.867 (2867198000)|WF_EMAIL_SENT|Template:00XZ0000000DYd4|Recipients:pranavlal@nowitmatters.com |CcEmails:
10:33:19.867 (2867231000)|WF_ACTION| Email Alert: 1;
10:33:19.867 (2867246000)|WF_RULE_EVAL_BEGIN|Escalation
10:33:19.867 (2867253000)|WF_RULE_EVAL_END
10:33:19.869 (2869665000)|WF_ACTIONS_END| Email Alert: 1;
10:33:19.869 (2869678000)|CODE_UNIT_FINISHED|Workflow:01IZ00000004M4T
10:33:19.869 (2869748000)|DML_END|[290]
10:33:19.869 (2869814000)|METHOD_ENTRY|[291]|01pZ00000008Yzi|TSWPageController.setEvent(SOBJECT:Event__c)
10:33:19.869 (2869882000)|METHOD_EXIT|[291]|01pZ00000008Yzi|TSWPageController.setEvent(SOBJECT:Event__c)
10:33:19.869 (2869940000)|DML_BEGIN|[297]|Op:Insert|Type:Trip__c|Rows:1
10:33:19.902 (2902536000)|CODE_UNIT_STARTED|[EXTERNAL]|Workflow:01IZ00000004MFW
10:33:19.910 (2910542000)|WF_RULE_EVAL_BEGIN|Assignment
10:33:19.910 (2910565000)|WF_RULE_EVAL_BEGIN|Response
10:33:19.910 (2910576000)|WF_RULE_EVAL_BEGIN|Workflow
10:33:19.910 (2910598000)|WF_CRITERIA_BEGIN|[Trip: Test Trip 12ac1234 a09Z0000000A5Q7]|Update Trip Name|01QZ0000000CjeT|ON_ALL_CHANGES
10:33:19.910 (2910624000)|WF_RULE_FILTER|[Trip : Created By not equal to null]
10:33:19.910 (2910645000)|WF_RULE_EVAL_VALUE|005A0000000qX36
10:33:19.910 (2910653000)|WF_CRITERIA_END|true
10:33:19.910 (2910676000)|WF_SPOOL_ACTION_BEGIN|Workflow
10:33:19.910 (2910917000)|WF_FIELD_UPDATE|[Trip: Test Trip 12ac1234 a09Z0000000A5Q7]|Field:Trip: Trip Name|Value:2011-12-06  |Id=04YZ00000008Pyk|CurrentRule:Update Trip Name (Id=01QZ0000000CjeT)
10:33:19.910 (2910944000)|WF_ACTION| Field Update: 1;
10:33:19.910 (2910956000)|WF_RULE_EVAL_BEGIN|Escalation
10:33:19.910 (2910963000)|WF_RULE_EVAL_END
10:33:19.922 (2922505000)|WF_ACTIONS_END| Field Update: 1;
10:33:19.922 (2922515000)|CODE_UNIT_FINISHED|Workflow:01IZ00000004MFW
10:33:19.922 (2922568000)|DML_END|[297]
10:33:19.922 (2922615000)|METHOD_ENTRY|[298]|01pZ00000008Yzi|TSWPageController.setTrip(SOBJECT:Trip__c)
10:33:19.922 (2922670000)|METHOD_EXIT|[298]|01pZ00000008Yzi|TSWPageController.setTrip(SOBJECT:Trip__c)
10:33:19.922 (2922697000)|METHOD_ENTRY|[301]|01pZ00000008Yzi|TSWPageController.submit()
10:33:19.922 (2922816000)|DML_BEGIN|[204]|Op:Insert|Type:Account|Rows:1
10:33:19.924 (2924030000)|DML_END|[204]
10:33:19.924 (2924157000)|VF_PAGE_MESSAGE|cannot specify Id in an insert call
10:33:19.924 (2924295000)|EXCEPTION_THROWN|[204]|System.DmlException: Insert failed. First exception on row 0 with id 001Z0000002ZmiiIAC; first error: INVALID_FIELD_FOR_INSERT_UPDATE, cannot specify Id in an insert call: [Id]
10:33:19.925 (2925398000)|METHOD_EXIT|[301]|01pZ00000008Yzi|TSWPageController.submit()
10:33:19.927 (2927380000)|FATAL_ERROR|System.DmlException: Insert failed. First exception on row 0 with id 001Z0000002ZmiiIAC; first error: INVALID_FIELD_FOR_INSERT_UPDATE, cannot specify Id in an insert call: [Id]

Class.TSWPageController.submit: line 204, column 7
Class.TSWPageControllerTest.validateSubmit: line 301, column 23
External entry point
10:33:20.395 (2927448000)|CUMULATIVE_LIMIT_USAGE
10:33:20.395|LIMIT_USAGE_FOR_NS|(default)|
 

steve456steve456

Class.TSWPageController.submit: line 204, column 7
Class.TSWPageControllerTest.validateSubmit: line 301, column 23

 

 

probably u have a soql query in this controllers...please screen shot these lines of code as mentioned and also chck the workflow rules on this object