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?

  • 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). – artfulrobot Mar 24 '15 at 16:46
  • You may be interested by this post : civicrm.stackexchange.com/questions/25078/… – Jacques-Marie Moranne May 24 '18 at 9:37
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, privacy policy and cookie policy

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