function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
sadasiva07sadasiva07 

Problem for test coverage for last week created Activities(Urgent )

We are creating a custom VF page reports that shows last week activities which associated to Accounts.

 

We are facing problem in getting proper test coverage, because we are fetching the Activities on  created date only,

 

But to coverage this portion of code we have create Activities that are belong to last week in our test class, but the field was non writable in salesforce.

 

Is their any alter native way to do this .

 

Thanks in advance.

Starz26Starz26

Add a flag to check if(test.isRunning == True CreatedDate CRITERIAFORTHISWEEK) to the class so that if test is not running it looks at last week and if test isrunning is check for dates in this week