Answers.Body: <p>UPDATE - instead of the workaround have a look at the answer to this more recent question
  <a href="https://civicrm.stackexchange.com/questions/29230/how-to-create-tokens-for-custom-fields-participant-individual-organisation">How to create tokens for custom fields (participant, individual, organisation)</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-04-20T20:40:35.387Z
Answers.Text: Thanks for going back over lots of similar Questions and adding this answer.
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-04-20T13:36:46.177Z
Answers.LastActivityDate: 2019-04-20T13:36:46.177Z
Answers.UserDisplayName: Davy Ivins
Answers.Body: <p>I found a workaround by creating custom contact (rather than participant) fields, as it is possible to add tokens for custom contact fields to the Contribution Invoice Receipt template. </p>
  
  <p>Here is the process for other non-developers like me:</p>
  
  <ol>
  <li>Create the necessary custom fields (select Contacts in the Used For field)</li>
  <li>Create a profile that includes the new custom fields</li>
  <li>Add the profile to the Fees section of the Event configuration. Now when delegates register they can complete the new fields.</li>
  <li>Add a token for the custom field to the Contribution Invoice Receipt template (the format for the custom fields is {contact.custom_12} where 12 is the ID of the custom data field. To find the ID, go Administer > Customize Data &amp; Screens > Custom Fields and click ‘edit’ on the field you want to use. Look at the URL. The last part of the URL will be an equal sign and a number (=12). The number (12 in this example) is the id of that custom field.) <em>(Thanks Joe Murray for that bit of help)</em></li>
  </ol>
  
  <p>Caveat: The workaround is not ideal as the PO number is likely to change every time the person makes a new registration so the history will not be retained.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-24T13:06:18.080Z
Answers.LastActivityDate: 2017-04-24T13:06:18.080Z
Answers.UserDisplayName: Davy Ivins
Answers.Body: <p>I'm not sure if this is possible - until very recently (version 4.7.17), there wasn't support for custom contribution tokens on a receipt, let alone participant custom tokens.  See <a href="https://issues.civicrm.org/jira/browse/CRM-8526" rel="nofollow noreferrer">CRM-8526</a> for details.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-24T12:50:34.187Z
Answers.Text: Thanks Jon. I'll keep an eye on the progress. I found a workaround in the meantime.
Answers.UserDisplayName: Davy Ivins
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-22T16:11:36.967Z
Answers.LastActivityDate: 2017-04-22T16:11:36.967Z
Answers.UserDisplayName: Jon G - Megaphone Tech
Body: <p>Can anyone provide guidance how to create tokens for custom participant fields, to be added into a  Contribution Invoice Receipt for event registrations? Our tax system requires that VAT registration numbers are included in all invoices, and we want to also add purchase order numbers.</p>
  
  <p>(Drupal, Civi 4.7)</p>
  
  <p>Many thanks
  Davy</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-04-24T11:06:09.170Z
Comments.Text: I don't really understand why you need a token to get the VAT number in there. Why don't you just edit the template used for your Receipt / Invoice and put the VAT number directly in the HTML
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-04-24T12:49:48.197Z
Comments.Text: Hi Pete. I had already edited the template to add the event organiser's VAT number etc., but also need to add the VAT and purchase order number of the person registering to attend (or more accurately their company's VAT number). I have found a workaround by creating custom contact (rather than participant) fields - the custom field tokens for contacts {contact.custom_XXX} work perfectly in the Invoice pdf. (although this is not ideal as the PO number will change every time the person makes a new registration.)
Comments.UserDisplayName: Davy Ivins
Tags: <civievent><custom-fields><tokens>
Title: Event invoice (receipt) - custom tokens
ThreadText: # Event invoice (receipt) - custom tokens
  
  (Asked by: username_0 on 2017-04-22)
  
  Can anyone provide guidance how to create tokens for custom participant fields, to be added into a Contribution Invoice Receipt for event registrations? Our tax system requires that VAT registration numbers are included in all invoices, and we want to also add purchase order numbers.
  
  (Drupal, Civi 4.7)
  
  Many thanks
  Davy
  
  **Tags:** civievent, custom-fields, tokens
  
  > **Comments:**
  > **username_1**: I don't really understand why you need a token to get the VAT number in there. Why don't you just edit the template used for your Receipt / Invoice and put the VAT number directly in the HTML  
  > **username_0**: Hi Pete. I had already edited the template to add the event organiser's VAT number etc., but also need to add the VAT and purchase order number of the person registering to attend (or more accurately their company's VAT number). I have found a workaround by creating custom contact (rather than participant) fields - the custom field tokens for contacts {contact.custom_XXX} work perfectly in the Invoice pdf. (although this is not ideal as the PO number will change every time the person makes a new registration.)  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_0 on 2019-04-20. Score: 1 | Accepted answer
  
  UPDATE - instead of the workaround have a look at the answer to this more recent question
  [How to create tokens for custom fields (participant, individual, organisation)](https://civicrm.stackexchange.com/questions/29230/how-to-create-tokens-for-custom-fields-participant-individual-organisation)
  
  > **Comments:**
  > **username_1**: Thanks for going back over lots of similar Questions and adding this answer.  
  
  ---
  
  ### Answer by username_0 on 2017-04-24. Score: 1
  
  I found a workaround by creating custom contact (rather than participant) fields, as it is possible to add tokens for custom contact fields to the Contribution Invoice Receipt template.
  
  Here is the process for other non-developers like me:
  
  1. Create the necessary custom fields (select Contacts in the Used For field)
  2. Create a profile that includes the new custom fields
  3. Add the profile to the Fees section of the Event configuration. Now when delegates register they can complete the new fields.
  4. Add a token for the custom field to the Contribution Invoice Receipt template (the format for the custom fields is {contact.custom\_12} where 12 is the ID of the custom data field. To find the ID, go Administer > Customize Data & Screens > Custom Fields and click ‘edit’ on the field you want to use. Look at the URL. The last part of the URL will be an equal sign and a number (=12). The number (12 in this example) is the id of that custom field.) *(Thanks Joe Murray for that bit of help)*
  
  Caveat: The workaround is not ideal as the PO number is likely to change every time the person makes a new registration so the history will not be retained.
  
  
  ---
  
  ### Answer by username_2 on 2017-04-22. Score: 1
  
  I'm not sure if this is possible - until very recently (version 4.7.17), there wasn't support for custom contribution tokens on a receipt, let alone participant custom tokens. See [CRM-8526](https://issues.civicrm.org/jira/browse/CRM-8526) for details.
  
  > **Comments:**
  > **username_0**: Thanks Jon. I'll keep an eye on the progress. I found a workaround in the meantime.  
  
  ---
  
  