title: Trigger to copy image from child record to parent record
body: <p>I am trying to write a trigger that will update a RTA field on a parent object with an image from a RTA field on the child object.</p>
  
  <p>I am getting the below error when creating the child object</p>
  
  <blockquote>
    <p>Apex trigger Updateparent caused an unexpected exception, contact your administrator: Updateparent: execution of AfterInsert caused by: System.StringException: Invalid id: (.....IMAGE IS DISPLAYED HERE....)External entry point.</p>
  </blockquote>
  
  <h2>    Info</h2>
  
  <p>Man Utd is the child object
  Account is the parent object
  Image__c is the RTA field on the child object
  Copy_image__c is the RTA field on accounts</p>
  
  <p><strong>Here is the trigger code</strong></p>
  
  <pre class="lang-apex prettyprint-override"><code>trigger Updateparent on Man_Utd_1__c (after insert, after update) {
  
      Map&lt;ID, Account&gt; parentAccounts = new Map&lt;ID, Account&gt;();
  
      List&lt;Id&gt; listIds = new List&lt;Id&gt;();
  
      for (Man_Utd_1__c childObj : Trigger.new) {
          listIds.add(childObj.Image__c);
      }
  
      parentAccounts = new Map&lt;Id, Account&gt;([SELECT id, (SELECT ID, Image__c FROM Man_Utd_s__r) FROM Account WHERE ID IN :listIds]);
  
      for (Man_Utd_1__c manu : Trigger.new) {
          Account myParentAccounts = parentAccounts.get(manu.Image__c);
          myParentAccounts.Copy_image__c = manu.Image__c;
      }
  
      update parentAccounts.values();
  }
  </code></pre>
  
  <p>Can anyone advise on how to rectify this or if it is even possible to do?</p>