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 »
  • Report and Search UI Discussion (Moderators: CiviTeacher.com, TwoMice) »
  • Changing 'mode' or object for custom searches
Pages: [1]

Author Topic: Changing 'mode' or object for custom searches  (Read 949 times)

nickholden

  • I post occasionally
  • **
  • Posts: 111
  • Karma: 1
  • CiviCRM version: 4.4.1
  • CMS version: Drupal 7
  • MySQL version: 5.5.32
  • PHP version: 5.4
Changing 'mode' or object for custom searches
February 19, 2014, 08:28:34 am
In the Advanced search, there's the very nice feature of being able to set the 'Display results as...' field so that the results are conceptually something other than contacts (e.g. activities, cases, whatever). As a result of this, the tasks that can be performed on the result set change according to what type of object is being displayed.

Is there a way of getting this functionality into custom searches? Either as a flexible option as per the Advanced Search, or by hard-coding a particular custom search to return activity objects rather than contact objects?

Currently the custom searches (even the core-provided one called 'Activity Search') return results sets comprised of contacts - as a result the task list which is available to the result set is the contact tasks, not the activity tasks. If I want to be able to run a custom search and return activities, not contacts, as the result objects, what is the best way to accomplish this?

I thought I'd be able to set a default 'component_mode' as a hidden field in the form, and that did give access to the tasks that I wanted. However, in the process it also messed up the result template, presumably because setting the component mode changes more than just which set of tasks are appropriate. Is there a more fine-grained approach I can take?

Thanks

Nick

DizzyMissLizzy

  • I’m new here
  • *
  • Posts: 6
  • Karma: 0
  • CiviCRM version: 4.4
  • CMS version: Drupal
  • MySQL version: 5
  • PHP version: 5.3
Re: Changing 'mode' or object for custom searches
April 02, 2014, 01:03:25 am
Anyone with advice? I need this too.

Lies

joanne

  • Administrator
  • Ask me questions
  • *****
  • Posts: 852
  • Karma: 83
  • CiviCRM version: 4.4.16
  • CMS version: Drupal 7
Re: Changing 'mode' or object for custom searches
April 02, 2014, 03:56:17 am
In general, for custom searches you can "Add contacts to group" ( if this a one time exercise) or create a "New smart group" (if you will want to use the same search criteria on many occasions)  Then advanced search for members of that group and  display results however you want to.  That way you can access the task list  that you want.

With particular reference to the custom 'Activity search' - I am not sure why you would choose to use that rather than search for activities through advanced search. Searching for activities through advanced search provides all of the filters in the custom activity search and some extra ones as well.



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: Changing 'mode' or object for custom searches
April 02, 2014, 12:33:24 pm

this would be a great feature to add and would require a fair bit of investigation and development.

Would either of your orgs be able to fund some investigation into this? I suspect we'll need 20-25 hours to figure out the feasibility and potentially implement it (which might require a few more hours depending on complexity)

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

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • Report and Search UI Discussion (Moderators: CiviTeacher.com, TwoMice) »
  • Changing 'mode' or object for custom searches

This forum was archived on 2017-11-26.