• Alex Stalteri
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
Hi All,

I'm a new admin and do not have any developer experience, so any help would be greatly appreciated!

I've added new tasks to an existing apex class button and it works perfectly in my sandbox instance but when I validate the change in production before deployment I received the following error code:

System.AssertException: Assertion Failed 
Stack Trace: Class.TestCreateOnboardingTasks.verifyTasksCreated: line 51, column 1

This is line 45-59 in my apex class:

Task t = new Task();
        t.WhatId = accountID;
        t.WhoId = champion.Id;
        t.Subject = 'Onboarding: Day 7';
        t.ActivityDate = a.Subscription_Start_Date__c.addDays(7);
        t.OwnerId = a.OwnerId;
        insert t;
        
        t = new Task();
        t.WhatId = accountID;
        t.WhoId = champion.Id;
        t.Subject = 'Onboarding: Day 15';
        t.ActivityDate = a.Subscription_Start_Date__c.addDays(15);
        t.OwnerId = a.OwnerId;
        insert t;

Any ideas on what to do for it to pass the validation test?
Hi All,

I'm a new admin and do not have any developer experience, so any help would be greatly appreciated!

I've added new tasks to an existing apex class button and it works perfectly in my sandbox instance but when I validate the change in production before deployment I received the following error code:

System.AssertException: Assertion Failed 
Stack Trace: Class.TestCreateOnboardingTasks.verifyTasksCreated: line 51, column 1

This is line 45-59 in my apex class:

Task t = new Task();
        t.WhatId = accountID;
        t.WhoId = champion.Id;
        t.Subject = 'Onboarding: Day 7';
        t.ActivityDate = a.Subscription_Start_Date__c.addDays(7);
        t.OwnerId = a.OwnerId;
        insert t;
        
        t = new Task();
        t.WhatId = accountID;
        t.WhoId = champion.Id;
        t.Subject = 'Onboarding: Day 15';
        t.ActivityDate = a.Subscription_Start_Date__c.addDays(15);
        t.OwnerId = a.OwnerId;
        insert t;

Any ideas on what to do for it to pass the validation test?
Hi All,

I'm a new admin and do not have any developer experience, so any help would be greatly appreciated!

I've added new tasks to an existing apex class button and it works perfectly in my sandbox instance but when I validate the change in production before deployment I received the following error code:

System.AssertException: Assertion Failed 
Stack Trace: Class.TestCreateOnboardingTasks.verifyTasksCreated: line 51, column 1

This is line 45-59 in my apex class:

Task t = new Task();
        t.WhatId = accountID;
        t.WhoId = champion.Id;
        t.Subject = 'Onboarding: Day 7';
        t.ActivityDate = a.Subscription_Start_Date__c.addDays(7);
        t.OwnerId = a.OwnerId;
        insert t;
        
        t = new Task();
        t.WhatId = accountID;
        t.WhoId = champion.Id;
        t.Subject = 'Onboarding: Day 15';
        t.ActivityDate = a.Subscription_Start_Date__c.addDays(15);
        t.OwnerId = a.OwnerId;
        insert t;

Any ideas on what to do for it to pass the validation test?