Answers.Body: <p>Price sets relating to any <strong>contribution record</strong>(apart from contribution pages) also need to be deleted before removing any fields from the priceset.</p>
  
  <p>Since Contribution need this field information to show them on viewing those contribution record, it doesn't let us to delete the fields or pricesets related to them.</p>
  
  <p>To know what contribution or membership record are related to pricesets - execute this query - </p>
  
  <pre><code>SELECT DISTINCT cli.entity_table, cli.entity_id
  FROM      civicrm_line_item cli
  LEFT JOIN civicrm_price_field cpf ON cli.price_field_id = cpf.id
  WHERE     cpf.price_set_id = &lt;your_price_set_id&gt;
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-07-31T05:40:58.490Z
Answers.Text: Okay. So what stumped me was that none of those payments involved the Price Field I was trying to remove. I understand why it wouldn't want me removing fields that have values in the _line_item table, but in this case there were none. If you can get a PR done to let this happen it would remove a modicum of pain for users in same situation. Thx
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-11-11T23:16:23.673Z
Answers.Text: What if you don't want to see them any more :-) Could you just delete the priceset?
Answers.UserDisplayName: KarinG - Semper IT
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-07-31T03:36:37.900Z
Answers.LastActivityDate: 2017-09-18T07:12:36.600Z
Answers.LastEditDate: 2017-09-18T07:12:36.600Z
Answers.UserDisplayName: jitendra - fuzion
Body: <p>Initially I had a warning that the Price Set was in use, with a useful link to the page in question.</p>
  
  <p>I then removed the Price Set from the Contribution page in question, but I am now getting the same message ie</p>
  
  <blockquote>
    <p>Unable to delete the 'xxx' Price Field - it is currently in use by one or more active events or contribution pages or contributions or event templates. If you no longer want to use this price set, click the contribution page title below, and modify the Amounts or Membership tab configuration. </p>
  </blockquote>
  
Tags: <price-sets>
Title: Unable to delete Price Field from Price Set used for Contributions
ThreadText: # Unable to delete Price Field from Price Set used for Contributions
  
  (Asked by: username_0 on 2017-07-31)
  
  Initially I had a warning that the Price Set was in use, with a useful link to the page in question.
  
  I then removed the Price Set from the Contribution page in question, but I am now getting the same message ie
  
  > Unable to delete the 'xxx' Price Field - it is currently in use by one or more active events or contribution pages or contributions or event templates. If you no longer want to use this price set, click the contribution page title below, and modify the Amounts or Membership tab configuration.
  
  **Tags:** price-sets
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-07-31. Score: 4 | Accepted answer
  
  Price sets relating to any **contribution record**(apart from contribution pages) also need to be deleted before removing any fields from the priceset.
  
  Since Contribution need this field information to show them on viewing those contribution record, it doesn't let us to delete the fields or pricesets related to them.
  
  To know what contribution or membership record are related to pricesets - execute this query -
  
  ```
  SELECT DISTINCT cli.entity_table, cli.entity_id
  FROM      civicrm_line_item cli
  LEFT JOIN civicrm_price_field cpf ON cli.price_field_id = cpf.id
  WHERE     cpf.price_set_id = <your_price_set_id>
  
  ```
  
  > **Comments:**
  > **username_0**: Okay. So what stumped me was that none of those payments involved the Price Field I was trying to remove. I understand why it wouldn't want me removing fields that have values in the _line_item table, but in this case there were none. If you can get a PR done to let this happen it would remove a modicum of pain for users in same situation. Thx  
  > **username_2**: What if you don't want to see them any more :-) Could you just delete the priceset?  
  
  ---
  
  