Answers.Body: <p>There isn't any such setting to set by default financial type on backend new contribution form.</p>
  <p>However you can set it default programatically to a specific FT using buildform hook by calling $form-&gt;setDefault(['financial_type_id' =&gt; 1]); or JS.</p>
  <p>It would be nice to have a config where you could set the default financial type to be so that you don't need to hard code in php/js</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-07-17T01:35:58.293Z
Answers.Text: Can the buildfrom hook be used on the default New Contributions page, or do I need to create a new custom form to use this?
Answers.UserDisplayName: jsherk
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-07-17T18:08:55.483Z
Answers.Text: Nope you don't need to
Answers.UserDisplayName: Pradeep Nayak
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-07-18T02:01:15.033Z
Answers.Text: Ok so maybe I was not clear, but I am asking how do I call/use a buildform hook?
Answers.UserDisplayName: jsherk
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-07-18T04:24:37.743Z
Answers.Text: Ok, so I was actually looking for an answer of "how do I call buildform hook" ... Can it somehow be used on default New Contributions page? If yes, how? Or do I need to create a custom extension that will call the buildform hook for me?
Answers.UserDisplayName: jsherk
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-07-18T07:36:50.007Z
Answers.Text: Hooks need to be implemented via extensions or modules or plugins. Yes, you will need to create an extension and implement the buildform hook
Answers.UserDisplayName: Pradeep Nayak
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-07-27T19:09:31.630Z
Answers.Text: Ok I figured out how to create an extension module in order to implement the hook: https://civicrm.stackexchange.com/questions/42359/how-to-create-a-custom-extension-module-with-an-example
Answers.UserDisplayName: jsherk
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-01-26T17:51:07.870Z
Answers.Text: ok I am still new to CiviCRM so will have to investigate how to use a buildform hook.
Answers.UserDisplayName: jsherk
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-01-26T02:09:38.913Z
Answers.LastActivityDate: 2022-01-26T02:09:38.913Z
Answers.UserDisplayName: Pradeep Nayak
Answers.Body: <p>You can also use the <a href="https://civicrm.org/extensions/entity-templates" rel="nofollow noreferrer">Entity Templates</a> extension to set up templates of contribution defaults. There can be a few tricks, but if you're willing to update the templates via API you can customize quite well (e.g. set receive_date: null to still have it default to today).</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-05-08T00:24:19.527Z
Answers.LastActivityDate: 2023-05-08T00:24:19.527Z
Answers.UserDisplayName: Lars SG
Body: <p>When I add a New Contribution, the Financial Type is required, but it is not preselected.</p>
  <p>I would like to set a specific Financial Type as a defualt so it is already selected in the Financial Type dropdown when I click on New Contribution.</p>
  <p>Is there a setting for this somewhere? I looked thru all the Admin menus but could not find one.</p>
  <p>Thanks</p>
  <p>EDIT:</p>
  <p>I accepted the answer below about using a hook, but also posted a more detailed answer here:
  <a href="https://civicrm.stackexchange.com/questions/42359/how-to-create-a-custom-extension-module-with-an-example">How to create a custom extension/module (with an example)?</a></p>
  
Tags: <civicontribute><financial-types>
Title: Set a default Financial Type when adding New Contribution?
ThreadText: # Set a default Financial Type when adding New Contribution?
  
  (Asked by: username_0 on 2022-01-26)
  
  When I add a New Contribution, the Financial Type is required, but it is not preselected.
  
  I would like to set a specific Financial Type as a defualt so it is already selected in the Financial Type dropdown when I click on New Contribution.
  
  Is there a setting for this somewhere? I looked thru all the Admin menus but could not find one.
  
  Thanks
  
  EDIT:
  
  I accepted the answer below about using a hook, but also posted a more detailed answer here:
  [How to create a custom extension/module (with an example)?](https://civicrm.stackexchange.com/questions/42359/how-to-create-a-custom-extension-module-with-an-example)
  
  **Tags:** civicontribute, financial-types
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2022-01-26. Score: 0 | Accepted answer
  
  There isn't any such setting to set by default financial type on backend new contribution form.
  
  However you can set it default programatically to a specific FT using buildform hook by calling $form->setDefault(['financial\_type\_id' => 1]); or JS.
  
  It would be nice to have a config where you could set the default financial type to be so that you don't need to hard code in php/js
  
  > **Comments:**
  > **username_0**: ok I am still new to CiviCRM so will have to investigate how to use a buildform hook.  
  > **username_0**: Can the buildfrom hook be used on the default New Contributions page, or do I need to create a new custom form to use this?  
  > **username_1**: Nope you don't need to  
  > **username_0**: Ok so maybe I was not clear, but I am asking how do I call/use a buildform hook?  
  > **username_0**: Ok, so I was actually looking for an answer of "how do I call buildform hook" ... Can it somehow be used on default New Contributions page? If yes, how? Or do I need to create a custom extension that will call the buildform hook for me?  
  > **username_1**: Hooks need to be implemented via extensions or modules or plugins. Yes, you will need to create an extension and implement the buildform hook  
  > **username_0**: Ok I figured out how to create an extension module in order to implement the hook: https://civicrm.stackexchange.com/questions/42359/how-to-create-a-custom-extension-module-with-an-example  
  
  ---
  
  ### Answer by username_2 on 2023-05-08. Score: 0
  
  You can also use the [Entity Templates](https://civicrm.org/extensions/entity-templates) extension to set up templates of contribution defaults. There can be a few tricks, but if you're willing to update the templates via API you can customize quite well (e.g. set receive\_date: null to still have it default to today).
  
  
  ---
  
  