7

I've followed the documentation to create a custom search and I find this capability to be quite powerful for finding and displaying information about contacts.

Now I would like to create a custom search to show a specific set of contributions and then (most importantly) allow me to perform actions on those specific contributions (e.g. "export contributions", "send thank-you letters").

Is this possible? If so, how?

2
  • Yeah, custom searches for contribs work mostly the same way (from memory - think you just copy a different file to get you started), ditto the doing things known as "search tasks" - I added a search task that duplicates selected payments with today's date (assists with entering payments given regularly). Commented Mar 24, 2015 at 16:46
  • You may be interested by this post : civicrm.stackexchange.com/questions/25078/… Commented May 24, 2018 at 9:37

1 Answer 1

5

Start with the code for Find Contributions (https://github.com/civicrm/civicrm-core/blob/master/CRM/Contribute/Form/SearchContribution.php) and customize it as necessary to get the results you want, eg by hardcoding some values.

Next, choose a task similar to what you want to do from the list at https://github.com/civicrm/civicrm-core/tree/master/CRM/Contribute/Form/Task, and copy and modify it as necessary. Next, after reviewing https://github.com/civicrm/civicrm-core/blob/master/CRM/Contribute/Task.php, find a hook like buildForm to modify the search form so it includes your new task(s).

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.