CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Some advice/pointers/suggestions for a Custom Search.
Pages: [1]

Author Topic: Some advice/pointers/suggestions for a Custom Search.  (Read 801 times)

nzampella

  • I post occasionally
  • **
  • Posts: 61
  • Karma: 2
  • CiviCRM version: 4.5.3
  • CMS version: Joomla 3.3.6
  • MySQL version: 5.5.36
  • PHP version: 5.4.31
Some advice/pointers/suggestions for a Custom Search.
December 17, 2011, 06:51:00 pm
Joomla 1.7 - Civicrm 4.0

All I'm trying to do is provide a custom search that requires no input from the user, but just displays the result of the SQL query.

The SQL works exactly the way I want it to.  Tested this in phpMyAdmin without a hitch.  What I'd like is for the user to just select the menu item, and the system just displays the results.

However, using the procedures in the Documentation for custom searches, would result in a blank screen.    So, I tried again, this time step by step to see if I can get a search form displaying.  Works fine.   Add the SQL code, blank screen.

I add the troubleshooting code as advised in the documentation, blank screen.   Tried adding some echo statements to see where I was getting to in the search, blank screen, and nothing in any logs.

I admit my PHP skills are rudimentary at best, but I've been programming for about 20 years, starting with Fortran, and moving up to C++, and am getting very frustrated.  I don't like admitting defeat, but this has fought me to a standstill, and doing all nighters trying to get this working has cost me sleep, which at my age (60ish) is not a good thing ;)

Any pointers, suggestions, skeleton code would be appreciated.

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Some advice/pointers/suggestions for a Custom Search.
December 17, 2011, 07:59:02 pm
One tip, one suggestion ...

1. Adding &force=1 at the end of any search URL will force the search query to run.

2. I would start with a simple custom search that runs and then modify it. Maybe start with
CRM/Contact/Form/Search/Custom/Sample.php

... which you can run from this URL: &task=civicrm/contact/search/custom?reset=1&csid=1&force=1
Protect your investment in CiviCRM by  becoming a Member!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Some advice/pointers/suggestions for a Custom Search.

This forum was archived on 2017-11-26.