• ella macrow
  • 0 Points
  • Member since 2021

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
  • 3
I've been at this for three days, I've read 300 blogs, nothing at all has gotten me even 1% test coverage on my simple trigger that updates ownerid on content version insert.

I am totally defeated. 
trigger ConDoc on ContentVersion (after insert) {

    List<ContentVersion> conver = [SELECT Id, Title, OwnerId FROM ContentVersion WHERE Id IN: Trigger.newMap.keySet()];

    for (ContentVersion CV: conver){
        CV.OwnerId= '005F0000002QTR2';

    update conver;


The closest i've got is below, its giving me a "
System.InvalidParameterValueException: Provide the ID of a test-context sObject as the first parameter for setCreatedDate()." error
public class Test_ConDocTrigger{
    static testMethod void contentDoc() {
    list<ContentVersion>conver = new list<ContentVersion>();

     //ContentDocument cd = [SELECT Id FROM ContentDocument ];

     ContentVersion cv = new ContentVersion();
     //cv.ContentDocumentId = '069M0000000Tpig';
     cv.Title ='con';
     test.setCreatedDate(cv.Id, DateTime.now());
     insert cv;


When checking this challenge, I get an error stating that the quickContact Lightning Component could not be found. Including screenshots of the steps I took thus far. Any advice would be appreciated!

1. The Lightning component must be named quickContact (this comes as part of the package, confirmed in picture below)
User-added image

2. Create a new action with Label Quick Contact and Name Quick_Contact on the Account object that invokes the quickContact component. (confirmed in picture below)
User-added image
3. Add the appropriate interfaces to the quickContact component. (Hint: there are two.) (used the implements force:lightningquickaction AND the force:hasrecordid on line 1, confirmed in picture below)
User-added image

4. Add the action to the Account Layout page layout. (added in picture below)
User-added image