+ Start a Discussion
cloudtripcloudtrip 

NEED HELP PLEASE - to deploy to production by tomorrow please help - currently at 65%

Here is the start of my class method:
___________________________________________________________________
 

public class TradeCalendarController {

    // Set class variable
  public Trade_Calender__c nitch;
  public Trade_Events__c trade;
  
    //set List variables
    Trade_Events__c[] recList; 
    Trade_Events__c[] recDelete; 
        
    //STANDARD CONTROLLER SECTION
 
 public TradeCalendarController(Trade_Calender__c item){
    this.nitch = item;

}  
   public String getParam(String name) {
        return ApexPages.currentPage().getParameters().get(name);   
    }

public TradeCalendarController(ApexPages.StandardController stdController) {
    this.nitch = (Trade_Calender__c)stdController.getRecord();
        
    recList = [ Select
    Trade_Calender__c,
    Name,
    Account__c,
    Year__c,
    Category__c,
    Vendor__c,
    Period__c,
    New_Pack__c,
    Promo_Price__c, 
    Merch_Type__c,
    More_than_1_event_in_period__c,
    Event_start_in_prior_period__c,  
    Events_del__c
    From Trade_Events__c
    WHERE
    Trade_Calender__c = :nitch.id order by Pack__c, period__c];
    
    if(recList.size()==0){
        newRow();
    }
}
// returns Record information
 public Trade_Events__c[] getRecList() { 
   return recList; 
}
      
 // Inserts all changes into records
 public pagereference saveChanges() { 
update nitch;
try {
upsert recList;
} catch (DMLException e){
     ApexPages.addMessages(e);
   return null;

     }
// after save refreshes data on page
  recList = [ Select
    Trade_Calender__c,
    Name,
    Account__c,
    Year__c,
    Category__c,
    Vendor__c,
    Period__c,
    New_Pack__c,
    Promo_Price__c,
    Merch_Type__c,
    More_than_1_event_in_period__c,
    Event_start_in_prior_period__c,
    Events_del__c
    From Trade_Events__c
    WHERE
    Trade_Calender__c = :nitch.id order by Pack__c, period__c];

   getRecList();
 
return null;
}

 // Inserts a new row
 public pagereference newRow() { 

  Trade_Events__c d = new Trade_Events__c();
  for(Trade_Calender__c trade:[Select id, name, account__c, Year__c from Trade_Calender__c where id = :nitch.id]){
  d.Account__c = trade.account__c;
  d.Name = trade.name;
  d.Year__c = trade.Year__c;
  d.Trade_Calender__c = nitch.id;
  recList.add(d);

}
return null;

 }

// clones a row
 public PageReference cl() {
 String delid = getParam('delid');
 Trade_Events__c d = new Trade_Events__c();
  for(Trade_Events__c trade:[Select id, Pack__c, Vendor__c, Merch_Type__c, Promo_Price__c, Category__c, name, account__c, Year__c from Trade_Events__c where Trade_Calender__c=:nitch.id and ID=:delid]){
  d.Account__c = trade.account__c;
  d.Name = trade.name;
  d.Year__c = trade.Year__c;
  d.Trade_Calender__c = nitch.id;
  d.New_Pack__c = trade.Pack__c;
  d.Merch_Type__c = trade.Merch_Type__c;
  d.Pack__c ='a0y40000000LzEK';
  d.Promo_Price__c = trade.Promo_Price__c;
  d.Category__c = trade.Category__c;
  d.Vendor__c = trade.Vendor__c;
  recList.add(d);

 }

   return null;
   }
 // delete row
 public PageReference del() {
        try {
            String delid = getParam('delid');
            Trade_Events__c event = [SELECT Id FROM Trade_Events__c WHERE ID=:delid];
            DELETE event;
        } catch (Exception e) {
            ApexPages.addMessages(e);
        }
// after del refreshes the data on page
    recList = [ Select
    Trade_Calender__c,
    Name,
    Account__c,
    Year__c,
    Category__c,
    Vendor__c,
    Period__c,
    New_Pack__c,
    Promo_Price__c,
    Merch_Type__c,
    More_than_1_event_in_period__c,
    Event_start_in_prior_period__c,
    Events_del__c
    From Trade_Events__c
    WHERE
    Trade_Calender__c = :nitch.id order by Pack__c, period__c];
    getRecList();
    return null;
    }

}

 

cloudtripcloudtrip

Here is my test method and cant figure out why it wont pass....

 

 

public class TestTradeCalendar {

//public Trade_Calender__c tc;
//public Trade_Events__c te;

public static testmethod void test_eg(){
Account acct = new Account();
acct.Name = 'TEST ACCT';
insert acct;

Trade_Calender__c tc = new Trade_Calender__c();
tc.Name = 'TEST TradeCalendar';
tc.Year__c = '2013';
tc.Account__c = acct.id;
insert tc;

system.debug(tc);

PageReference tradeVF = Page.TradeVF;
Test.setCurrentPageReference(tradeVF);

//this.tc = tradeVF.StandardController.getRecList();
//ApexPages.currentPage().getParameters().put(tc.id);//your parameter
//ApexPages.StandardController sc = new ApexPages.StandardController(acct);//acct is account instance this is account standard controller

TradeCalendarController tcc = new TradeCalendarController(tc);

//PageReference returnPage = new PageReference('/apex/tcc.returnpage');       
//PageReference cancelChanges = new PageReference('/apex/tcc.CancelChanges');       

Trade_Calender__c tc1 = new Trade_Calender__c();
tc1.Name = 'TEST TradeCalendar';
tc1.Year__c = '2013';
tc1.Account__c = acct.id;

try {
insert tc1;}
 catch (Exception e){
 system.AssertNotEquals(e, null);}

try {
 tcc.newRow();}
 catch (Exception e){
 system.AssertNotEquals(e, null);}


//if (tcc.RectList.size()==0){

//}
//System.assertEquals(newRow, null);

Trade_Events__c te = new Trade_Events__c();
te.Trade_Calender__c = tc.Id;
te.Account__c = acct.Id;
te.Year__c = tc.Year__c;
te.Category__c ='Confections';
te.Vendor__c ='Competitor';
te.Period__c ='P1';
te.Promo_Price__c ='2';
te.Merch_Type__c ='TPR';
te.Category__c ='Gum';
te.Vendor__c ='Competitor';  
insert te;

List<Trade_Events__c> te1 = tcc.getRecList();

tcc.cl();

tcc.del();

//te1[1].Period__c ='junk';

try {tcc.saveChanges();}
 catch (Exception e){
 system.AssertNotEquals(e, null);}
/*
try {te2 = [ Select
    Trade_Calender__c,
    Name,
    Account__c,
    Year__c,
    Category__c,
    Vendor__c,
    Period__c,
    Pack__c,
    New_Pack__c,
    Promo_Price__c,
    Merch_Type__c,
    More_than_1_event_in_period__c,
    Event_start_in_prior_period__c,
    Events_del__c
    From Trade_Events__c
WHERE
Trade_Calender__c = :tc.id order by Pack__c, period__c limit 1];
       
}catch(System.QueryException e){
}system.debug(te);
insert te2;
*/


//tcc.getRecList();

}
}

 

 

Starz26Starz26

If you could tell us what error you are getting, it will speed up a response...

spraetzspraetz

and also please post code using the code block function in the forum.  I makes it 100x easier to read.

cloudtripcloudtrip

 

 Here is the correct debug and coverage log, sorry I am working on several test methods:

 

General Warnings
Average test coverage across all Apex Classes and Triggers is 63%, at least 75% test coverage is required.
LaunchDuplicateTrigger
Test coverage of selected Apex Trigger is 0%, at least 1% test coverage is required
Code Coverage Results
TestTradeCalendar ﴾ApexClass﴿ ‐‐ 0 lines not tested, 100% covered
TradeCalendarController ﴾ApexClass﴿ ‐‐ 21 lines not tested, 65% covered
Line 21, Column 0 not covered
Line 22, Column 0 not covered
Line 24, Column 0 not covered
Line 42, Column 0 not covered
Line 43, Column 0 not covered
Line 56, Column 0 not covered
Line 57, Column 0 not covered
Line 58, Column 0 not covered
Line 97, Column 0 not covered
Line 106, Column 0 not covered
Line 107, Column 0 not covered
Line 108, Column 0 not covered
Line 109, Column 0 not covered
Line 110, Column 0 not covered
Line 111, Column 0 not covered
Line 112, Column 0 not covered
Line 113, Column 0 not covered
Line 114, Column 0 not covered
Line 115, Column 0 not covered
Line 116, Column 0 not covered
Line 127, Column 0 not covered
TradeDuplicateTrigger ﴾ApexTrigger﴿ ‐‐ 0 lines not tested, 100% covered
LaunchDuplicateTrigger ﴾ApexTrigger﴿ ‐‐ 4 lines not tested, 0% covered
Line 2, Column 0 not covered
Line 4, Column 0 not covered
Line 6, Column 0 not covered
Line 7, Column 0 not covered
***********************************************************************

16:04:57.971 ﴾971988000﴿|WF_RULE_EVAL_BEGIN|Escalation
16:04:57.972 ﴾972028000﴿|WF_RULE_EVAL_END
16:04:57.972 ﴾972187000﴿|WF_ACTIONS_END| Field Update: 1;
16:04:57.972 ﴾972218000﴿|CODE_UNIT_FINISHED|Workflow:01IR00000000oXB
16:04:57.976 ﴾976774000﴿|DML_END|[55]
16:04:57.977 ﴾977288000﴿|SOQL_EXECUTE_BEGIN|[62]|Aggregations:0| Select
Trade_Calender__c,
Name,
Account__c,
Year__c,
Category__c,
Vendor__c,
Period__c,
New_Pack__c,
Promo_Price__c,
Merch_Type__c,
More_than_1_event_in_period__c,
Event_start_in_prior_period__c,
Events_del__c
From Trade_Events__c
WHERE
Trade_Calender__c = :nitch.id order by Pack__c, period__c
16:04:57.982 ﴾982536000﴿|SOQL_EXECUTE_END|[62]|Rows:1
16:04:57.982 ﴾982858000﴿|METHOD_ENTRY|[80]|01pR00000005L4z|TradeCalendarController.getRecList﴾﴿
16:04:57.983 ﴾983083000﴿|METHOD_EXIT|[80]|01pR00000005L4z|TradeCalendarController.getRecList﴾﴿
16:04:57.983 ﴾983195000﴿|METHOD_EXIT|[64]|01pR00000005L4z|TradeCalendarController.saveChanges﴾﴿
16:04:57.983 ﴾983291000﴿|METHOD_ENTRY|[68]|01pR00000005L4z|TradeCalendarController.cl﴾﴿
16:04:57.983 ﴾983420000﴿|METHOD_ENTRY|[103]|01pR00000005L4z|TradeCalendarController.getParam﴾String﴿
16:04:57.983 ﴾983543000﴿|SYSTEM_METHOD_ENTRY|[18]|MAP.get﴾ANY﴿
16:04:57.983 ﴾983587000﴿|SYSTEM_METHOD_ENTRY|[18]|System.PageReference.getParameters﴾﴿
16:04:57.983 ﴾983618000﴿|SYSTEM_METHOD_ENTRY|[18]|ApexPages.currentPage﴾﴿
16:04:57.983 ﴾983650000﴿|SYSTEM_METHOD_EXIT|[18]|ApexPages.currentPage﴾﴿
16:04:57.983 ﴾983691000﴿|SYSTEM_METHOD_EXIT|[18]|System.PageReference.getParameters﴾﴿
16:04:57.983 ﴾983785000﴿|SYSTEM_METHOD_EXIT|[18]|MAP.get﴾ANY﴿
16:04:57.983 ﴾983907000﴿|METHOD_EXIT|[103]|01pR00000005L4z|TradeCalendarController.getParam﴾String﴿
16:04:57.984 ﴾984044000﴿|SOQL_EXECUTE_BEGIN|[105]|Aggregations:0|Select id, Pack__c, Vendor__c, Merch_Type__c, Promo_Price__c, Category__c, name, account__c, Year__c from Trade_Events__c where
Trade_Calender__c=:nitch.id and ID=:delid
16:04:57.987 ﴾987640000﴿|SOQL_EXECUTE_END|[105]|Rows:0
16:04:57.987 ﴾987824000﴿|METHOD_EXIT|[68]|01pR00000005L4z|TradeCalendarController.cl﴾﴿
16:04:57.987 ﴾987961000﴿|METHOD_ENTRY|[72]|01pR00000005L4z|TradeCalendarController.getRecList﴾﴿
16:04:57.988 ﴾988169000﴿|METHOD_EXIT|[72]|01pR00000005L4z|TradeCalendarController.getRecList﴾﴿
16:04:57.988 ﴾988312000﴿|METHOD_ENTRY|[76]|01pR00000005L4z|TradeCalendarController.del﴾﴿
16:04:57.988 ﴾988507000﴿|METHOD_ENTRY|[125]|01pR00000005L4z|TradeCalendarController.getParam﴾String﴿
16:04:57.988 ﴾988677000﴿|SYSTEM_METHOD_ENTRY|[18]|MAP.get﴾ANY﴿
16:04:57.988 ﴾988737000﴿|SYSTEM_METHOD_ENTRY|[18]|System.PageReference.getParameters﴾﴿
16:04:57.988 ﴾988787000﴿|SYSTEM_METHOD_ENTRY|[18]|ApexPages.currentPage﴾﴿
16:04:57.988 ﴾988837000﴿|SYSTEM_METHOD_EXIT|[18]|ApexPages.currentPage﴾﴿
16:04:57.988 ﴾988897000﴿|SYSTEM_METHOD_EXIT|[18]|System.PageReference.getParameters﴾﴿
16:04:57.988 ﴾988985000﴿|SYSTEM_METHOD_EXIT|[18]|MAP.get﴾ANY﴿
16:04:57.989 ﴾989103000﴿|METHOD_EXIT|[125]|01pR00000005L4z|TradeCalendarController.getParam﴾String﴿
16:04:57.989 ﴾989321000﴿|SOQL_EXECUTE_BEGIN|[126]|Aggregations:0|SELECT Id FROM Trade_Events__c WHERE ID=:delid
16:04:57.992 ﴾992181000﴿|SOQL_EXECUTE_END|[126]|Rows:0
16:04:57.992 ﴾992349000﴿|EXCEPTION_THROWN|[126]|System.QueryException: List has no rows for assignment to SObject
16:04:57.992 ﴾992484000﴿|SYSTEM_METHOD_ENTRY|[129]|ApexPages.addMessages﴾APEX_OBJECT﴿
16:04:57.992 ﴾992886000﴿|SYSTEM_METHOD_EXIT|[129]|ApexPages.addMessages﴾APEX_OBJECT﴿
16:04:57.993 ﴾993639000﴿|SOQL_EXECUTE_BEGIN|[132]|Aggregations:0| Select
Trade_Calender__c,
Name,
Account__c,
Year__c,
Category__c,
Vendor__c,
Period__c,
New_Pack__c,
Promo_Price__c,
Merch_Type__c,
More_than_1_event_in_period__c,
Event_start_in_prior_period__c,
Events_del__c
From Trade_Events__c
WHERE
Trade_Calender__c = :nitch.id order by Pack__c, period__c
16:04:58.000 ﴾1000818000﴿|SOQL_EXECUTE_END|[132]|Rows:1
16:04:58.001 ﴾1001138000﴿|METHOD_ENTRY|[149]|01pR00000005L4z|TradeCalendarController.getRecList﴾﴿
16:04:58.001 ﴾1001389000﴿|METHOD_EXIT|[149]|01pR00000005L4z|TradeCalendarController.getRecList﴾﴿
16:04:58.001 ﴾1001537000﴿|METHOD_EXIT|[76]|01pR00000005L4z|TradeCalendarController.del﴾﴿
16:04:58.002 ﴾1002366000﴿|SOQL_EXECUTE_BEGIN|[80]|Aggregations:0| Select
Trade_Calender__c,
Name,
Account__c,
Year__c,
Category__c,
Vendor__c,
Period__c,
Pack__c,
New_Pack__c,
Promo_Price__c,
Merch_Type__c,
More_than_1_event_in_period__c,
Event_start_in_prior_period__c,
Events_del__c
From Trade_Events__c
WHERE Trade_Calender__c = :tc.id order by Pack__c, period__c limit 1
16:04:58.008 ﴾1008631000﴿|SOQL_EXECUTE_END|[80]|Rows:1
16:04:58.008 ﴾1008854000﴿|SYSTEM_METHOD_ENTRY|[99]|System.debug﴾ANY﴿
16:04:58.009 ﴾1009315000﴿|USER_DEBUG|[99]|DEBUG|Trade_Events__c:{Account__c=001R000000ecd0bIAA, Merch_Type__c=TPR, Trade_Calender__c=a0oR0000000QJOlIAO, Vendor__c=Competitor, Year__c=2013,
Category__c=Gum, Id=a0vR00000006EGKIA2, Promo_Price__c=2, Period__c=P1}
16:04:58.009 ﴾1009385000﴿|SYSTEM_METHOD_EXIT|[99]|System.debug﴾ANY﴿
16:04:58.009 ﴾1009519000﴿|METHOD_ENTRY|[105]|01pR00000005L4z|TradeCalendarController.getRecList﴾﴿
16:04:58.009 ﴾1009756000﴿|METHOD_EXIT|[105]|01pR00000005L4z|TradeCalendarController.getRecList﴾﴿
16:04:58.338 ﴾1009856000﴿|CUMULATIVE_LIMIT_USAGE
16:04:58.338|LIMIT_USAGE_FOR_NS|﴾default﴿|
Number of SOQL queries: 11 out of 100
Number of query rows: 6 out of 50000
Number of SOSL queries: 0 out of 20
Number of DML statements: 9 out of 150
Number of DML rows: 9 out of 10000
Number of script statements: 104 out of 200000
Maximum heap size: 0 out of 3000000
Number of callouts: 0 out of 10
Number of Email Invocations: 0 out of 10
Number of fields describes: 0 out of 100
Number of record type describes: 0 out of 100
Number of child relationships describes: 0 out of 100
Number of picklist describes: 0 out of 100
Number of future calls: 0 out of 10

16:04:58.338 ﴾1009856000﴿|CUMULATIVE_LIMIT_USAGE_END

16:04:58.010 ﴾1010006000﴿|CODE_UNIT_FINISHED|TestTradeCalendar.test_eg
16:04:58.010 ﴾1010048000﴿|EXECUTION_FINISHED


 

 

cloudtripcloudtrip

Hope that helps, any assistance is greatly appreciated.

spraetzspraetz

You're never setting the Cost_Share_Management__c field.

cloudtripcloudtrip

Does anyone have any ideas?

Starz26Starz26

You post right above it made it sound like your situation was resolved........

 

Also you said you posted the "wrong one". In order to help we need accurate information...

cloudtripcloudtrip

Everything posted below is correct, I removed the incorrect information. Sorry for the confusion.

Starz26Starz26

In your test case you are not setting the parameter for delid which is causing all your select statements that use IN :delid to return no rows.

 

in your test, after you set the pagereference add the line:

 

system.currentPageReference().getParameters().put('delID','WHATEVER THE ID SHOULD BE');



cloudtripcloudtrip

I did add the following but my code is still at 63%

 

system.currentPageReference().getParameters().put('delid', tc.Id);

Starz26Starz26

Look at the debug log....

 

1. Are the Select statements still returning 0 rows?

2. System.debug the delID and see what it is using for that value

3. Is nischID being set properly, system.debug that as well since you are pulling records based on both.

 

 

post up the new debug log (with both IDs printed out and the section of your code where you placed the new line please.

 

 

cloudtripcloudtrip
public class TestTradeCalendar {

public static testmethod void test_eg(){
Account acct = new Account();
acct.Name = 'TEST ACCT';
insert acct;
system.debug(acct);

Trade_Calender__c tc = new Trade_Calender__c();
tc.Name = 'TEST TradeCalendar';
tc.Year__c = '2013';
tc.Account__c = acct.id;
insert tc;
system.debug(tc);

PageReference tradeVF = Page.TradeVF;
Test.setCurrentPageReference(tradeVF);
system.debug(tradeVF);

ApexPages.StandardController sc = new ApexPages.StandardController(acct);//acct is account instance this is account standard controller
TradeCalendarController tcc = new TradeCalendarController(tc);
PageReference returnPage = new PageReference('/apex/tcc.returnpage');        
PageReference cancelChanges = new PageReference('/apex/tcc.CancelChanges');  
system.currentPageReference().getParameters().put('delid', acct.Id);
system.debug(acct);

Trade_Calender__c tc1 = new Trade_Calender__c();
tc1.Name = 'TEST TradeCalendar';
tc1.Year__c = '2013';
tc1.Account__c = acct.id;

try {
insert tc1;}
catch (Exception e){
system.AssertNotEquals(e, null);}

try {
insert acct;}
catch (Exception e){
system.AssertNotEquals(e, null);} 

try {
tcc.newRow();} 
catch (Exception e){
system.AssertNotEquals(e, null);}

Trade_Events__c te = new Trade_Events__c();
te.Trade_Calender__c = tc.Id;
te.Account__c = acct.Id;
te.Year__c = tc.Year__c;
te.Category__c ='Confections';
te.Vendor__c ='Competitor';
te.Period__c ='P1';
te.Promo_Price__c ='2';
te.Merch_Type__c ='TPR';
te.Category__c ='Gum';
te.Vendor__c ='Competitor'; 
insert te;

List<Trade_Events__c> te1 = tcc.getRecList();
tcc.cl();
tcc.del(); 
tcc.saveChanges();
tcc.getRecList();

try {tcc.saveChanges();}
catch (Exception e){
system.AssertNotEquals(e, null);}

try {tcc.cl();}
catch (Exception e){
system.AssertNotEquals(e, null);}

try {tcc.getRecList();}
catch (Exception e){
system.AssertNotEquals(e, null);}

try {tcc.del();}
catch (Exception e){
system.AssertNotEquals(e, null);}

try {te1 = [ Select
Trade_Calender__c,
Name,
Account__c,
Year__c,
Category__c,
Vendor__c,
Period__c,
Pack__c,
New_Pack__c,
Promo_Price__c,
Merch_Type__c,
More_than_1_event_in_period__c,
Event_start_in_prior_period__c,
Events_del__c
From Trade_Events__c
WHERE Trade_Calender__c = :tc.id order by Pack__c, period__c limit 1];
        
}catch(System.QueryException e){
}system.debug(te);

//insert te1;

tcc.getRecList();

}
}

 

cloudtripcloudtrip
Debug Log:

22.0 APEX_CODE,DEBUG;APEX_PROFILING,INFO;CALLOUT,INFO;DB,INFO;VALIDATION,INFO;WORKFLOW,INFO
14:52:42.308 (308329000)|EXECUTION_STARTED
14:52:42.308 (308405000)|CODE_UNIT_STARTED|[EXTERNAL]|01pR00000005Q59|TestTradeCalendar.test_eg
14:52:42.308 (308494000)|METHOD_ENTRY|[1]|01pR00000005Q59|TestTradeCalendar.TestTradeCalendar()
14:52:42.308 (308549000)|METHOD_EXIT|[1]|TestTradeCalendar
14:52:42.308 (308822000)|DML_BEGIN|[6]|Op:Insert|Type:Account|Rows:1
14:52:42.331 (331676000)|CODE_UNIT_STARTED|[EXTERNAL]|Validation:Account:new
14:52:42.331 (331725000)|VALIDATION_RULE|03d40000000Ci5d|Billing_State_for_US
14:52:42.332 (332429000)|VALIDATION_FORMULA|AND ( 
OR(BillingCountry = "US", BillingCountry="USA", LEN(BillingCountry)=0), 
AND( 
LEN(BillingState) <>0, 
NOT( 
CONTAINS("AL:AK:AZ:AR:CA:CO:CT:DE:DC:FL:GA:HI:ID:" & 
"IL:IN:IA:KS:KY:LA:ME:MD:MA:MI:MN:MS:MO:MT:NE:NV:NH:" & 
"NJ:NM:NY:NC:ND:OH:OK:OR:PA:RI:SC:SD:TN:TX:UT:VT:VA:" & 
"WA:WV:WI:WY", BillingState) 
)))|BillingCountry=null , BillingState=null
14:52:42.332 (332473000)|VALIDATION_PASS
14:52:42.332 (332497000)|VALIDATION_RULE|03d40000000Ci5Y|Shipping_State_for_US
14:52:42.333 (333169000)|VALIDATION_FORMULA|AND ( 
OR(ShippingCountry = "US", ShippingCountry="USA", LEN(ShippingCountry)=0), 
AND( 
LEN(ShippingState) <> 0, 
NOT( 
CONTAINS("AL:AK:AZ:AR:CA:CO:CT:DE:DC:FL:GA:HI:ID:" & 
"IL:IN:IA:KS:KY:LA:ME:MD:MA:MI:MN:MS:MO:MT:NE:NV:NH:" & 
"NJ:NM:NY:NC:ND:OH:OK:OR:PA:RI:SC:SD:TN:TX:UT:VT:VA:" & 
"WA:WV:WI:WY", ShippingState) 
)))|ShippingCountry=null , ShippingState=null
14:52:42.333 (333212000)|VALIDATION_PASS
14:52:42.333 (333234000)|CODE_UNIT_FINISHED|Validation:Account:new
14:52:42.383 (383088000)|DML_END|[6]
14:52:42.383 (383323000)|USER_DEBUG|[7]|DEBUG|Account:{Name=TEST ACCT, Id=001R000000ecnx3IAA}
14:52:42.384 (384098000)|DML_BEGIN|[13]|Op:Insert|Type:Trade_Calender__c|Rows:1
14:52:42.467 (467245000)|CODE_UNIT_STARTED|[EXTERNAL]|01qR00000004aEn|TradeDuplicateTrigger on Trade_Calender trigger event BeforeInsert for [new]
14:52:42.467 (467729000)|SOQL_EXECUTE_BEGIN|[4]|Aggregations:0|select Account__c, Year__c from Trade_Calender__c 
    where Year__c = :c.Year__c and Account__c = :c.Account__c
14:52:42.480 (480908000)|SOQL_EXECUTE_END|[4]|Rows:0
14:52:43.051 (481197000)|CUMULATIVE_LIMIT_USAGE
14:52:43.051|LIMIT_USAGE_FOR_NS|(default)|
  Number of SOQL queries: 1 out of 100
  Number of query rows: 0 out of 50000
  Number of SOSL queries: 0 out of 20
  Number of DML statements: 2 out of 150
  Number of DML rows: 2 out of 10000
  Number of script statements: 11 out of 200000
  Maximum heap size: 0 out of 3000000
  Number of callouts: 0 out of 10
  Number of Email Invocations: 0 out of 10
  Number of fields describes: 0 out of 100
  Number of record type describes: 0 out of 100
  Number of child relationships describes: 0 out of 100
  Number of picklist describes: 0 out of 100
  Number of future calls: 0 out of 10

14:52:43.051 (481197000)|CUMULATIVE_LIMIT_USAGE_END

14:52:42.481 (481311000)|CODE_UNIT_FINISHED|TradeDuplicateTrigger on Trade_Calender trigger event BeforeInsert for [new]
14:52:42.512 (512558000)|CODE_UNIT_STARTED|[EXTERNAL]|Workflow:01IR00000004syQ
14:52:42.549 (549728000)|WF_RULE_EVAL_BEGIN|Assignment
14:52:42.549 (549793000)|WF_RULE_EVAL_BEGIN|Response
14:52:42.549 (549827000)|WF_RULE_EVAL_BEGIN|Workflow
14:52:42.549 (549887000)|WF_CRITERIA_BEGIN|[Trade Calender: TEST TradeCalendar a0oR0000000QJTW]|TC Name 2|01QR0000000DDZR|ON_ALL_CHANGES
14:52:42.564 (564397000)|WF_RULE_FILTER|[Account : Account Name not equal to null]
14:52:42.564 (564463000)|WF_RULE_EVAL_VALUE|TEST ACCT
14:52:42.564 (564493000)|WF_CRITERIA_END|true
14:52:42.574 (574561000)|WF_SPOOL_ACTION_BEGIN|Workflow
14:52:42.586 (586983000)|WF_FIELD_UPDATE|[Trade Calender: TEST TradeCalendar a0oR0000000QJTW]|Field:Trade Calender: Trade Calender|Value:2013 |Id=04YR00000008h6H|CurrentRule:TC Name 2 (Id=01QR0000000DDZR)
14:52:42.587 (587056000)|WF_ACTION| Field Update: 1;
14:52:42.587 (587100000)|WF_RULE_EVAL_BEGIN|Escalation
14:52:42.587 (587130000)|WF_RULE_EVAL_END
14:52:42.599 (599051000)|WF_ACTIONS_END| Field Update: 1;
14:52:42.599 (599090000)|CODE_UNIT_FINISHED|Workflow:01IR00000004syQ
14:52:42.599 (599212000)|DML_END|[13]
14:52:42.599 (599566000)|USER_DEBUG|[14]|DEBUG|Trade_Calender__c:{Account__c=001R000000ecnx3IAA, Name=TEST TradeCalendar, Year__c=2013, Id=a0oR0000000QJTWIA4}
14:52:42.599 (599781000)|METHOD_ENTRY|[1]|Test.Test()
14:52:42.599 (599838000)|METHOD_EXIT|[1]|Test
14:52:42.600 (600205000)|USER_DEBUG|[18]|DEBUG|System.PageReference[/apex/tradevf]
14:52:42.600 (600452000)|METHOD_ENTRY|[1]|01pR00000005L4z|TradeCalendarController.TradeCalendarController()
14:52:42.600 (600502000)|METHOD_EXIT|[1]|TradeCalendarController
14:52:42.600 (600551000)|CONSTRUCTOR_ENTRY|[21]|01pR00000005L4z|<init>(Trade_Calender__c)
14:52:42.600 (600866000)|CONSTRUCTOR_EXIT|[21]|01pR00000005L4z|<init>(Trade_Calender__c)
14:52:42.601 (601513000)|USER_DEBUG|[25]|DEBUG|Account:{Name=TEST ACCT, Id=001R000000ecnx3IAA}
14:52:42.601 (601979000)|DML_BEGIN|[33]|Op:Insert|Type:Trade_Calender__c|Rows:1
14:52:42.618 (618745000)|CODE_UNIT_STARTED|[EXTERNAL]|01qR00000004aEn|TradeDuplicateTrigger on Trade_Calender trigger event BeforeInsert for [new]
14:52:42.619 (619196000)|SOQL_EXECUTE_BEGIN|[4]|Aggregations:0|select Account__c, Year__c from Trade_Calender__c 
    where Year__c = :c.Year__c and Account__c = :c.Account__c
14:52:42.625 (625791000)|SOQL_EXECUTE_END|[4]|Rows:1
14:52:42.626 (626270000)|VF_PAGE_MESSAGE|Duplicate Trade Year: Trade Year already exists for this Account!
14:52:43.196 (626414000)|CUMULATIVE_LIMIT_USAGE
14:52:43.196|LIMIT_USAGE_FOR_NS|(default)|
  Number of SOQL queries: 2 out of 100
  Number of query rows: 1 out of 50000
  Number of SOSL queries: 0 out of 20
  Number of DML statements: 3 out of 150
  Number of DML rows: 3 out of 10000
  Number of script statements: 33 out of 200000
  Maximum heap size: 0 out of 3000000
  Number of callouts: 0 out of 10
  Number of Email Invocations: 0 out of 10
  Number of fields describes: 0 out of 100
  Number of record type describes: 0 out of 100
  Number of child relationships describes: 0 out of 100
  Number of picklist describes: 0 out of 100
  Number of future calls: 0 out of 10

14:52:43.196 (626414000)|CUMULATIVE_LIMIT_USAGE_END

14:52:42.626 (626599000)|CODE_UNIT_FINISHED|TradeDuplicateTrigger on Trade_Calender trigger event BeforeInsert for [new]
14:52:42.627 (627425000)|DML_END|[33]
14:52:42.627 (627720000)|EXCEPTION_THROWN|[33]|System.DmlException: Insert failed. First exception on row 0; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, Duplicate Trade Year: Trade Year already exists for this Account!: [Year__c]
14:52:42.629 (629034000)|DML_BEGIN|[38]|Op:Insert|Type:Account|Rows:1
14:52:42.632 (632718000)|DML_END|[38]

 

cloudtripcloudtrip
14:52:42.632 (632927000)|VF_PAGE_MESSAGE|cannot specify Id in an insert call
14:52:42.633 (633009000)|EXCEPTION_THROWN|[38]|System.DmlException: Insert failed. First exception on row 0 with id 001R000000ecnx3IAA; first error: INVALID_FIELD_FOR_INSERT_UPDATE, cannot specify Id in an insert call: [Id]
14:52:42.634 (634125000)|METHOD_ENTRY|[43]|01pR00000005L4z|TradeCalendarController.newRow()
14:52:42.634 (634352000)|SOQL_EXECUTE_BEGIN|[89]|Aggregations:0|Select id, name, account__c, Year__c from Trade_Calender__c where id = :nitch.id
14:52:42.640 (640508000)|SOQL_EXECUTE_END|[89]|Rows:1
14:52:42.641 (641597000)|EXCEPTION_THROWN|[94]|System.NullPointerException: Attempt to de-reference a null object
14:52:42.641 (641726000)|METHOD_EXIT|[43]|01pR00000005L4z|TradeCalendarController.newRow()
14:52:42.643 (643156000)|DML_BEGIN|[58]|Op:Insert|Type:Trade_Events__c|Rows:1
14:52:42.692 (692329000)|CODE_UNIT_STARTED|[EXTERNAL]|Workflow:01IR00000000oXB
14:52:42.719 (719519000)|WF_RULE_EVAL_BEGIN|Assignment
14:52:42.719 (719582000)|WF_RULE_EVAL_BEGIN|Response
14:52:42.719 (719621000)|WF_RULE_EVAL_BEGIN|Workflow
14:52:42.719 (719687000)|WF_CRITERIA_BEGIN|[Trade Events: a0vR00000006EIz a0vR00000006EIz]|Trade Period 3|01QR00000004tMM|ON_ALL_CHANGES
14:52:42.727 (727403000)|WF_RULE_FILTER|[Trade Events : Period equals P3]
14:52:42.727 (727523000)|WF_RULE_EVAL_VALUE|1
14:52:42.727 (727574000)|WF_CRITERIA_END|false
14:52:42.727 (727654000)|WF_CRITERIA_BEGIN|[Trade Events: a0vR00000006EIz a0vR00000006EIz]|Trade Period 2|01QR00000004tMH|ON_ALL_CHANGES
14:52:42.727 (727797000)|WF_RULE_FILTER|[Trade Events : Period equals P2]
14:52:42.727 (727884000)|WF_RULE_EVAL_VALUE|1
14:52:42.727 (727934000)|WF_CRITERIA_END|false
14:52:42.728 (728009000)|WF_CRITERIA_BEGIN|[Trade Events: a0vR00000006EIz a0vR00000006EIz]|Trade Period 1|01QR00000004tMC|ON_ALL_CHANGES
14:52:42.728 (728172000)|WF_RULE_FILTER|[Trade Events : Period equals P1]
14:52:42.728 (728255000)|WF_RULE_EVAL_VALUE|1
14:52:42.728 (728309000)|WF_CRITERIA_END|true
14:52:42.737 (737295000)|WF_SPOOL_ACTION_BEGIN|Workflow
14:52:42.739 (739221000)|WF_FIELD_UPDATE|[Trade Events: a0vR00000006EIz a0vR00000006EIz]|Field:Trade Events: Period 1|Value:2 TPR|Id=04YR00000004dVQ|CurrentRule:Trade Period 1 (Id=01QR00000004tMC)
14:52:42.739 (739325000)|WF_ACTION| Field Update: 1;
14:52:42.739 (739381000)|WF_RULE_EVAL_BEGIN|Escalation
14:52:42.739 (739428000)|WF_RULE_EVAL_END
14:52:42.753 (753086000)|WF_ACTIONS_END| Field Update: 1;
14:52:42.753 (753131000)|CODE_UNIT_FINISHED|Workflow:01IR00000000oXB
14:52:42.765 (765608000)|CODE_UNIT_STARTED|[EXTERNAL]|Workflow:01IR00000004syQ
14:52:42.777 (777010000)|WF_RULE_EVAL_BEGIN|Assignment
14:52:42.777 (777070000)|WF_RULE_EVAL_BEGIN|Response
14:52:42.777 (777106000)|WF_RULE_EVAL_BEGIN|Workflow
14:52:42.777 (777172000)|WF_CRITERIA_BEGIN|[Trade Calender: 2013 a0oR0000000QJTW]|TC Name 2|01QR0000000DDZR|ON_ALL_CHANGES
14:52:42.777 (777275000)|WF_RULE_FILTER|[Account : Account Name not equal to null]
14:52:42.777 (777326000)|WF_RULE_EVAL_VALUE|TEST ACCT
14:52:42.777 (777359000)|WF_CRITERIA_END|true
14:52:42.777 (777419000)|WF_SPOOL_ACTION_BEGIN|Workflow
14:52:42.777 (777948000)|WF_ACTION| Field Update: 1;
14:52:42.777 (777987000)|WF_RULE_EVAL_BEGIN|Escalation
14:52:42.778 (778017000)|WF_RULE_EVAL_END
14:52:42.778 (778126000)|WF_ACTIONS_END| Field Update: 1;
14:52:42.778 (778156000)|CODE_UNIT_FINISHED|Workflow:01IR00000004syQ
14:52:42.778 (778329000)|DML_END|[58]
14:52:42.778 (778502000)|METHOD_ENTRY|[60]|01pR00000005L4z|TradeCalendarController.getRecList()
14:52:42.778 (778741000)|METHOD_EXIT|[60]|01pR00000005L4z|TradeCalendarController.getRecList()
14:52:42.778 (778914000)|METHOD_ENTRY|[61]|01pR00000005L4z|TradeCalendarController.cl()
14:52:42.779 (779088000)|METHOD_ENTRY|[103]|01pR00000005L4z|TradeCalendarController.getParam(String)
14:52:42.779 (779889000)|METHOD_EXIT|[103]|01pR00000005L4z|TradeCalendarController.getParam(String)
14:52:42.780 (780118000)|SOQL_EXECUTE_BEGIN|[105]|Aggregations:0|Select id, Pack__c, Vendor__c, Merch_Type__c, Promo_Price__c, Category__c, name, account__c, Year__c from Trade_Events__c where Trade_Calender__c=:nitch.id and ID=:delid
14:52:42.787 (787301000)|SOQL_EXECUTE_END|[105]|Rows:0
14:52:42.787 (787547000)|METHOD_EXIT|[61]|01pR00000005L4z|TradeCalendarController.cl()
14:52:42.787 (787687000)|METHOD_ENTRY|[62]|01pR00000005L4z|TradeCalendarController.del()
14:52:42.787 (787884000)|METHOD_ENTRY|[125]|01pR00000005L4z|TradeCalendarController.getParam(String)
14:52:42.788 (788369000)|METHOD_EXIT|[125]|01pR00000005L4z|TradeCalendarController.getParam(String)
14:52:42.788 (788640000)|SOQL_EXECUTE_BEGIN|[126]|Aggregations:0|SELECT Id FROM Trade_Events__c WHERE ID=:delid
14:52:42.792 (792322000)|SOQL_EXECUTE_END|[126]|Rows:0
14:52:42.792 (792507000)|EXCEPTION_THROWN|[126]|System.QueryException: List has no rows for assignment to SObject
14:52:42.792 (792838000)|VF_PAGE_MESSAGE|List has no rows for assignment to SObject
14:52:42.793 (793592000)|SOQL_EXECUTE_BEGIN|[132]|Aggregations:0| Select
    Trade_Calender__c,
    Name,
    Account__c,
    Year__c,
    Category__c,
    Vendor__c,
    Period__c,
    New_Pack__c,
    Promo_Price__c,
    Merch_Type__c,
    More_than_1_event_in_period__c,
    Event_start_in_prior_period__c,
    Events_del__c
    From Trade_Events__c
    WHERE
    Trade_Calender__c = :nitch.id order by Pack__c, period__c
14:52:42.812 (812422000)|SOQL_EXECUTE_END|[132]|Rows:1
14:52:42.812 (812784000)|METHOD_ENTRY|[149]|01pR00000005L4z|TradeCalendarController.getRecList()
14:52:42.813 (813018000)|METHOD_EXIT|[149]|01pR00000005L4z|TradeCalendarController.getRecList()
14:52:42.813 (813169000)|METHOD_EXIT|[62]|01pR00000005L4z|TradeCalendarController.del()
14:52:42.813 (813292000)|METHOD_ENTRY|[63]|01pR00000005L4z|TradeCalendarController.saveChanges()
14:52:42.813 (813440000)|DML_BEGIN|[53]|Op:Update|Type:Trade_Calender__c|Rows:1
14:52:42.834 (834534000)|CODE_UNIT_STARTED|[EXTERNAL]|Workflow:01IR00000004syQ
14:52:42.845 (845934000)|WF_RULE_EVAL_BEGIN|Assignment
14:52:42.846 (846013000)|WF_RULE_EVAL_BEGIN|Response
14:52:42.846 (846078000)|WF_RULE_EVAL_BEGIN|Workflow
14:52:42.846 (846168000)|WF_CRITERIA_BEGIN|[Trade Calender: TEST TradeCalendar a0oR0000000QJTW]|TC Name 2|01QR0000000DDZR|ON_ALL_CHANGES
14:52:42.846 (846325000)|WF_RULE_FILTER|[Account : Account Name not equal to null]
14:52:42.846 (846390000)|WF_RULE_EVAL_VALUE|TEST ACCT
14:52:42.846 (846436000)|WF_CRITERIA_END|true
14:52:42.846 (846522000)|WF_SPOOL_ACTION_BEGIN|Workflow
14:52:42.847 (847261000)|WF_FIELD_UPDATE|[Trade Calender: TEST TradeCalendar a0oR0000000QJTW]|Field:Trade Calender: Trade Calender|Value:2013 |Id=04YR00000008h6H|CurrentRule:TC Name 2 (Id=01QR0000000DDZR)
14:52:42.847 (847359000)|WF_ACTION| Field Update: 1;
14:52:42.847 (847411000)|WF_RULE_EVAL_BEGIN|Escalation
14:52:42.847 (847454000)|WF_RULE_EVAL_END
14:52:42.858 (858960000)|WF_ACTIONS_END| Field Update: 1;
14:52:42.859 (859024000)|CODE_UNIT_FINISHED|Workflow:01IR00000004syQ
14:52:42.859 (859204000)|DML_END|[53]
14:52:42.859 (859358000)|DML_BEGIN|[55]|Op:Upsert|Type:Trade_Events__c|Rows:1
14:52:42.876 (876797000)|CODE_UNIT_STARTED|[EXTERNAL]|Workflow:01IR00000000oXB
14:52:42.890 (890330000)|WF_RULE_EVAL_BEGIN|Assignment
14:52:42.890 (890410000)|WF_RULE_EVAL_BEGIN|Response
14:52:42.890 (890470000)|WF_RULE_EVAL_BEGIN|Workflow
14:52:42.890 (890564000)|WF_CRITERIA_BEGIN|[Trade Events: a0vR00000006EIz a0vR00000006EIz]|Trade Period 3|01QR00000004tMM|ON_ALL_CHANGES
14:52:42.890 (890694000)|WF_RULE_FILTER|[Trade Events : Period equals P3]
14:52:42.890 (890798000)|WF_RULE_EVAL_VALUE|1
14:52:42.890 (890849000)|WF_CRITERIA_END|false
14:52:42.890 (890925000)|WF_CRITERIA_BEGIN|[Trade Events: a0vR00000006EIz a0vR00000006EIz]|Trade Period 2|01QR00000004tMH|ON_ALL_CHANGES
14:52:42.891 (891035000)|WF_RULE_FILTER|[Trade Events : Period equals P2]
14:52:42.891 (891130000)|WF_RULE_EVAL_VALUE|1
14:52:42.891 (891180000)|WF_CRITERIA_END|false
14:52:42.891 (891255000)|WF_CRITERIA_BEGIN|[Trade Events: a0vR00000006EIz a0vR00000006EIz]|Trade Period 1|01QR00000004tMC|ON_ALL_CHANGES
14:52:42.891 (891364000)|WF_RULE_FILTER|[Trade Events : Period equals P1]
14:52:42.891 (891448000)|WF_RULE_EVAL_VALUE|1
14:52:42.891 (891497000)|WF_CRITERIA_END|true
14:52:42.891 (891588000)|WF_SPOOL_ACTION_BEGIN|Workflow
14:52:42.892 (892553000)|WF_ACTION| Field Update: 1;
14:52:42.892 (892622000)|WF_RULE_EVAL_BEGIN|Escalation
14:52:42.892 (892669000)|WF_RULE_EVAL_END
14:52:42.892 (892812000)|WF_ACTIONS_END| Field Update: 1;
14:52:42.892 (892855000)|CODE_UNIT_FINISHED|Workflow:01IR00000000oXB
14:52:42.897 (897646000)|DML_END|[55]
14:52:42.898 (898818000)|SOQL_EXECUTE_BEGIN|[62]|Aggregations:0| Select
    Trade_Calender__c,
    Name,
    Account__c,
    Year__c,
    Category__c,
    Vendor__c,
    Period__c,
    New_Pack__c,
    Promo_Price__c,
    Merch_Type__c,
    More_than_1_event_in_period__c,
    Event_start_in_prior_period__c,
    Events_del__c
    From Trade_Events__c
    WHERE
    Trade_Calender__c = :nitch.id order by Pack__c, period__c
14:52:42.911 (911251000)|SOQL_EXECUTE_END|[62]|Rows:1
14:52:42.911 (911592000)|METHOD_ENTRY|[80]|01pR00000005L4z|TradeCalendarController.getRecList()
14:52:42.911 (911801000)|METHOD_EXIT|[80]|01pR00000005L4z|TradeCalendarController.getRecList()
14:52:42.911 (911930000)|METHOD_EXIT|[63]|01pR00000005L4z|TradeCalendarController.saveChanges()
14:52:42.912 (912068000)|METHOD_ENTRY|[64]|01pR00000005L4z|TradeCalendarController.getRecList()
14:52:42.912 (912263000)|METHOD_EXIT|[64]|01pR00000005L4z|TradeCalendarController.getRecList()
14:52:42.912 (912388000)|METHOD_ENTRY|[66]|01pR00000005L4z|TradeCalendarController.saveChanges()
14:52:42.912 (912537000)|DML_BEGIN|[53]|Op:Update|Type:Trade_Calender__c|Rows:1
14:52:42.933 (933834000)|CODE_UNIT_STARTED|[EXTERNAL]|Workflow:01IR00000004syQ
14:52:42.943 (943903000)|WF_RULE_EVAL_BEGIN|Assignment
14:52:42.943 (943975000)|WF_RULE_EVAL_BEGIN|Response
14:52:42.944 (944012000)|WF_RULE_EVAL_BEGIN|Workflow
14:52:42.944 (944086000)|WF_CRITERIA_BEGIN|[Trade Calender: TEST TradeCalendar a0oR0000000QJTW]|TC Name 2|01QR0000000DDZR|ON_ALL_CHANGES
14:52:42.944 (944202000)|WF_RULE_FILTER|[Account : Account Name not equal to null]
14:52:42.944 (944250000)|WF_RULE_EVAL_VALUE|TEST ACCT
14:52:42.944 (944282000)|WF_CRITERIA_END|true
14:52:42.944 (944338000)|WF_SPOOL_ACTION_BEGIN|Workflow
14:52:42.944 (944860000)|WF_FIELD_UPDATE|[Trade Calender: TEST TradeCalendar a0oR0000000QJTW]|Field:Trade Calender: Trade Calender|Value:2013 |Id=04YR00000008h6H|CurrentRule:TC Name 2 (Id=01QR0000000DDZR)
14:52:42.944 (944923000)|WF_ACTION| Field Update: 1;
14:52:42.944 (944959000)|WF_RULE_EVAL_BEGIN|Escalation
14:52:42.944 (944990000)|WF_RULE_EVAL_END
14:52:42.953 (953912000)|WF_ACTIONS_END| Field Update: 1;
14:52:42.953 (953951000)|CODE_UNIT_FINISHED|Workflow:01IR00000004syQ
14:52:42.954 (954065000)|DML_END|[53]
14:52:42.954 (954201000)|DML_BEGIN|[55]|Op:Upsert|Type:Trade_Events__c|Rows:1
14:52:42.969 (969066000)|CODE_UNIT_STARTED|[EXTERNAL]|Workflow:01IR00000000oXB
14:52:42.982 (982822000)|WF_RULE_EVAL_BEGIN|Assignment
14:52:42.982 (982905000)|WF_RULE_EVAL_BEGIN|Response
14:52:42.982 (982963000)|WF_RULE_EVAL_BEGIN|Workflow
14:52:42.983 (983057000)|WF_CRITERIA_BEGIN|[Trade Events: a0vR00000006EIz a0vR00000006EIz]|Trade Period 3|01QR00000004tMM|ON_ALL_CHANGES
14:52:42.983 (983194000)|WF_RULE_FILTER|[Trade Events : Period equals P3]
14:52:42.983 (983286000)|WF_RULE_EVAL_VALUE|1
14:52:42.983 (983337000)|WF_CRITERIA_END|false
14:52:42.983 (983413000)|WF_CRITERIA_BEGIN|[Trade Events: a0vR00000006EIz a0vR00000006EIz]|Trade Period 2|01QR00000004tMH|ON_ALL_CHANGES
14:52:42.983 (983526000)|WF_RULE_FILTER|[Trade Events : Period equals P2]
14:52:42.983 (983606000)|WF_RULE_EVAL_VALUE|1
14:52:42.983 (983655000)|WF_CRITERIA_END|false
14:52:42.983 (983729000)|WF_CRITERIA_BEGIN|[Trade Events: a0vR00000006EIz a0vR00000006EIz]|Trade Period 1|01QR00000004tMC|ON_ALL_CHANGES
14:52:42.983 (983839000)|WF_RULE_FILTER|[Trade Events : Period equals P1]
14:52:42.983 (983920000)|WF_RULE_EVAL_VALUE|1
14:52:42.983 (983968000)|WF_CRITERIA_END|true
14:52:42.984 (984061000)|WF_SPOOL_ACTION_BEGIN|Workflow
14:52:42.984 (984798000)|WF_ACTION| Field Update: 1;
14:52:42.984 (984842000)|WF_RULE_EVAL_BEGIN|Escalation
14:52:42.984 (984871000)|WF_RULE_EVAL_END
14:52:42.984 (984965000)|WF_ACTIONS_END| Field Update: 1;
14:52:42.984 (984994000)|CODE_UNIT_FINISHED|Workflow:01IR00000000oXB
14:52:42.989 (989271000)|DML_END|[55]
14:52:42.990 (990028000)|SOQL_EXECUTE_BEGIN|[62]|Aggregations:0| Select
    Trade_Calender__c,
    Name,
    Account__c,
    Year__c,
    Category__c,
    Vendor__c,
    Period__c,
    New_Pack__c,
    Promo_Price__c,
    Merch_Type__c,
    More_than_1_event_in_period__c,
    Event_start_in_prior_period__c,
    Events_del__c
    From Trade_Events__c
    WHERE
    Trade_Calender__c = :nitch.id order by Pack__c, period__c
14:52:42.996 (996467000)|SOQL_EXECUTE_END|[62]|Rows:1
14:52:42.996 (996802000)|METHOD_ENTRY|[80]|01pR00000005L4z|TradeCalendarController.getRecList()
14:52:42.997 (997031000)|METHOD_EXIT|[80]|01pR00000005L4z|TradeCalendarController.getRecList()
14:52:42.997 (997192000)|METHOD_EXIT|[66]|01pR00000005L4z|TradeCalendarController.saveChanges()
14:52:42.997 (997322000)|METHOD_ENTRY|[70]|01pR00000005L4z|TradeCalendarController.cl()
14:52:42.997 (997500000)|METHOD_ENTRY|[103]|01pR00000005L4z|TradeCalendarController.getParam(String)
14:52:42.998 (998017000)|METHOD_EXIT|[103]|01pR00000005L4z|TradeCalendarController.getParam(String)
14:52:42.998 (998203000)|SOQL_EXECUTE_BEGIN|[105]|Aggregations:0|Select id, Pack__c, Vendor__c, Merch_Type__c, Promo_Price__c, Category__c, name, account__c, Year__c from Trade_Events__c where Trade_Calender__c=:nitch.id and ID=:delid
14:52:43.003 (1003076000)|SOQL_EXECUTE_END|[105]|Rows:0
14:52:43.003 (1003269000)|METHOD_EXIT|[70]|01pR00000005L4z|TradeCalendarController.cl()
14:52:43.003 (1003399000)|METHOD_ENTRY|[74]|01pR00000005L4z|TradeCalendarController.getRecList()
14:52:43.003 (1003612000)|METHOD_EXIT|[74]|01pR00000005L4z|TradeCalendarController.getRecList()
14:52:43.003 (1003737000)|METHOD_ENTRY|[78]|01pR00000005L4z|TradeCalendarController.del()
14:52:43.003 (1003932000)|METHOD_ENTRY|[125]|01pR00000005L4z|TradeCalendarController.getParam(String)
14:52:43.004 (1004394000)|METHOD_EXIT|[125]|01pR00000005L4z|TradeCalendarController.getParam(String)
14:52:43.004 (1004646000)|SOQL_EXECUTE_BEGIN|[126]|Aggregations:0|SELECT Id FROM Trade_Events__c WHERE ID=:delid
14:52:43.007 (1007954000)|SOQL_EXECUTE_END|[126]|Rows:0
14:52:43.008 (1008121000)|EXCEPTION_THROWN|[126]|System.QueryException: List has no rows for assignment to SObject
14:52:43.009 (1009076000)|SOQL_EXECUTE_BEGIN|[132]|Aggregations:0| Select
    Trade_Calender__c,
    Name,
    Account__c,
    Year__c,
    Category__c,
    Vendor__c,
    Period__c,
    New_Pack__c,
    Promo_Price__c,
    Merch_Type__c,
    More_than_1_event_in_period__c,
    Event_start_in_prior_period__c,
    Events_del__c
    From Trade_Events__c
    WHERE
    Trade_Calender__c = :nitch.id order by Pack__c, period__c
14:52:43.015 (1015176000)|SOQL_EXECUTE_END|[132]|Rows:1
14:52:43.015 (1015458000)|METHOD_ENTRY|[149]|01pR00000005L4z|TradeCalendarController.getRecList()
14:52:43.015 (1015672000)|METHOD_EXIT|[149]|01pR00000005L4z|TradeCalendarController.getRecList()
14:52:43.015 (1015820000)|METHOD_EXIT|[78]|01pR00000005L4z|TradeCalendarController.del()
14:52:43.016 (1016624000)|SOQL_EXECUTE_BEGIN|[82]|Aggregations:0| Select
Trade_Calender__c,
Name,
Account__c,
Year__c,
Category__c,
Vendor__c,
Period__c,
Pack__c,
New_Pack__c,
Promo_Price__c,
Merch_Type__c,
More_than_1_event_in_period__c,
Event_start_in_prior_period__c,
Events_del__c
From Trade_Events__c
WHERE Trade_Calender__c = :tc.id order by Pack__c, period__c limit 1
14:52:43.034 (1034722000)|SOQL_EXECUTE_END|[82]|Rows:1
14:52:43.035 (1035366000)|USER_DEBUG|[101]|DEBUG|Trade_Events__c:{Account__c=001R000000ecnx3IAA, Merch_Type__c=TPR, Trade_Calender__c=a0oR0000000QJTWIA4, Vendor__c=Competitor, Year__c=2013, Category__c=Gum, Id=a0vR00000006EIzIAM, Promo_Price__c=2, Period__c=P1}
14:52:43.035 (1035519000)|METHOD_ENTRY|[105]|01pR00000005L4z|TradeCalendarController.getRecList()
14:52:43.035 (1035725000)|METHOD_EXIT|[105]|01pR00000005L4z|TradeCalendarController.getRecList()
14:52:43.606 (1035819000)|CUMULATIVE_LIMIT_USAGE
14:52:43.606|LIMIT_USAGE_FOR_NS|(default)|
  Number of SOQL queries: 11 out of 100
  Number of query rows: 6 out of 50000
  Number of SOSL queries: 0 out of 20
  Number of DML statements: 9 out of 150
  Number of DML rows: 9 out of 10000
  Number of script statements: 106 out of 200000
  Maximum heap size: 0 out of 3000000
  Number of callouts: 0 out of 10
  Number of Email Invocations: 0 out of 10
  Number of fields describes: 0 out of 100
  Number of record type describes: 0 out of 100
  Number of child relationships describes: 0 out of 100
  Number of picklist describes: 0 out of 100
  Number of future calls: 0 out of 10

14:52:43.606 (1035819000)|CUMULATIVE_LIMIT_USAGE_END

14:52:43.035 (1035916000)|CODE_UNIT_FINISHED|TestTradeCalendar.test_eg
14:52:43.035 (1035945000)|EXECUTION_FINISHED

 

cloudtripcloudtrip

Does this help?

Starz26Starz26

Yes and you have a lot going on here....

 

Without being able to talk through it I cannot get my head around it as I am a do and fix kind of person....but

 

14:52:42.632 (632927000)|VF_PAGE_MESSAGE|cannot specify Id in an insert call
14:52:42.633 (633009000)|EXCEPTION_THROWN|[38]|System.DmlException: Insert failed. First exception on row 0 with id 001R000000ecnx3IAA; first error: INVALID_FIELD_FOR_INSERT_UPDATE, cannot specify Id in an insert call: [Id]
14:52:42.634 (634125000)|METHOD_ENTRY|[43]|01pR00000005L4z|TradeCalendarController.newRow()
14:52:42.634 (634352000)|SOQL_EXECUTE_BEGIN|[89]|Aggregations:0|Select id, name, account__c, Year__c from Trade_Calender__c where id = :nitch.id
14:52:42.640 (640508000)|SOQL_EXECUTE_END|[89]|Rows:1
14:52:42.641 (641597000)|EXCEPTION_THROWN|[94]|System.NullPointerException: Attempt to de-reference a null object

 

This is causing you some trouble here. You are specifying an ID for a new record and you cannot do that as it is assigned upon insert...

 

Also, the select statements where you used ID In :nisch.id and id In :delID are still returning 0 rows. I am not sure if it is due to the errors above since you were unable to insert the record or not.

 

Also, where you set the parameter, the current page reference is set to the pagereference right above it, what about the other two page references in the 2 lines above that, do they need the delID set?

 

Troubleshoot one item at a time. I would do it like this:

 

1. Fix the insert record so that it actually gets inserted

2. Set the correct parameters for each pager reference

3. Find out what the nisch.id and delID are when the select statement actually gets called and make sure they are what you want.

 

there may be more going on here so once you get those fixed, we can see what else needs updated.