1

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)?

2 Answers 2

2

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

7
  • ok I am still new to CiviCRM so will have to investigate how to use a buildform hook.
    – jsherk
    Jan 26, 2022 at 17:51
  • 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?
    – jsherk
    Jul 17, 2022 at 1:35
  • Nope you don't need to Jul 17, 2022 at 18:08
  • Ok so maybe I was not clear, but I am asking how do I call/use a buildform hook?
    – jsherk
    Jul 18, 2022 at 2:01
  • 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?
    – jsherk
    Jul 18, 2022 at 4:24
0

You can also use the 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).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.