title: Apex trigger to insert record in a related custom object based on insert on contact
body: <p>I have a custom object called 'contact relationship' which has lookup to contact and i have added a custom field of type checkbox called 'relationship' in contact.
  I want to write a trigger which adds a record in contact relationship every time a record is added in contact if the relationship checkbox value is true.
  This is what i have done, but it's not working.</p>
  
  <pre><code>trigger ContactRelationshipTrigger on Contact (after insert) {    
      List&lt;Contact_Relationship__c&gt; crl = new List&lt;Contact_Relationship__c&gt;();
      List&lt;Contact&gt; cl = new List&lt;Contact&gt;();
      for(contact con: trigger.new){
          if(con.Relationship__c == true){
              Contact_Relationship__c cr = new Contact_Relationship__c();
              cr.Contact__c=con.Id;
              cr.Name='Rel to--' + con.Name;
              crl.add(cr);
          }       
      }      
      insert crl;
  } 
  </code></pre>
  
  <p>When i insert a new contact record no contact relationship record is being created.</p>