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

How to Create Archived Task/Event in Test Method

Anyone know how you can create a Task or Event in the archived state (IsArchived = true) in a test method?  The field is READ-ONLY so it can't be set when you create your test records and you should always be creating the test records you reference in your tests so is there a special trick to getting Task and Event records into this state from withing test methods?