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) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • 'Auto-submit': advice for jumping straight to the results of a custom search
Pages: [1]

Author Topic: 'Auto-submit': advice for jumping straight to the results of a custom search  (Read 1357 times)

michaels23

  • I post occasionally
  • **
  • Posts: 77
  • Karma: 1
'Auto-submit': advice for jumping straight to the results of a custom search
May 04, 2009, 06:09:48 am
Hi all,

(Please forgive the rambling. I haven't figured out a concise way to ask for this advice.)

Are there any methods for pre-populating and then 'auto-submitting' the form for a custom search? I have some circumstances where I don't really need to bother the user with filling out the form. I'll try to expand with some hand-waving quasi-examples.

I have a custom search based on the Proximity example that I'm very happy with. I use this as the 'base' search for my site (http://aameetinglocator.org, FWIW). What I want to do next is create links from other nodes one the site that will pass arguments to the search and take the user directly to the results. In other words, the links will contain arguments that "pre-define" the search, so the user won't really need to fill out the form. When they click the link, I'd really like to take them straight to the search results.

Thanks in advance for any suggestions, or more questions to help me explain this better.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: 'Auto-submit': advice for jumping straight to the results of a custom search
May 04, 2009, 07:01:45 am

1. check: CRM/Contact/Form/Search/Custom/Sample.php

specifically lines 45-46. Those lines show you how to retrieve and use a value from a GET parameter

2. You can append force=1 to force the search

http://drupal.demo.civicrm.org/civicrm/contact/search/custom?csid=1&reset=1&stateID=1004&force=1

should give you all households from stateID 1004 (california)

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

michaels23

  • I post occasionally
  • **
  • Posts: 77
  • Karma: 1
Re: 'Auto-submit': advice for jumping straight to the results of a custom search
May 04, 2009, 11:04:23 am
 :-[ Nothing quite like asking a question to make one realize I knew the answer all along.  :-[

Many thanks!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • 'Auto-submit': advice for jumping straight to the results of a custom search

This forum was archived on 2017-11-26.