7

How can I save the Civicrm search results page URL to link to it directly later from any account. At present the link we get is based on the qkey that does not work once we logout and login later.

We want a URL that takes us directly to search result page & we should be able to pass filters also in the URL like date range etc.

5 Answers 5

7

I don't think it helps with passing the filters in the URL, but you can save the search as a Smart Group and then use the link to the contact list for that group. I think you can strip of the qfkey portion of the URL in this case. Something like this (although this smart group on the demo site will be deleted shortly, the URL structure is what I want to show):

http://d46.demo.civicrm.org/civicrm/contact/search/advanced?force=1&reset=1&ssID=1&context=advanced

3
  • Thanks laryn ! I tried "Smart Groups" but I am facing an issue here too. Smart groups provide a static saved search results page I am not able to provide it any filters , suppose i want the results within a specific date range, then how is it possible ??
    – Mayank
    Commented May 27, 2015 at 6:32
  • I'm not sure what kind of dates you are searching on, but (for example) you can search on birthdates for "Last three years" and the results will update each time cron is run (assuming you have enabled the "Rebuild Smart Group Cache" Scheduled Job and it is firing correctly). So they aren't static results.
    – Laryn
    Commented May 27, 2015 at 13:03
  • Ok I dont think "smart groups" will work for us then because we have build a custom report and we want to link for example : the activity search results page to our report based on the date ranges selected for the report.
    – Mayank
    Commented May 28, 2015 at 7:34
5

CiviCRM search pages don't accept filters from the url, but Drupal Views can. If you are using Drupal as your CMS, try that.

4

I wanted to leave a comment here because I came across this post looking for a this answer, and it may help someone else. (So this is probably only helpful to you as a clue, rather than as a complete answer to your question -- I'm not sure what types of queries you're trying to save.)

I was trying to do something similar with saving the URL of an advanced search to my navigation. My goal was to display results as Memberships (rather than the default contacts) and filtering by contacts in a certain group. (backstory: I needed to display as Memberships so I could export a file [using a saved field mapping] for printing membership cards, and I couldn't access membership info when exporting the contact only.)

This is the url that ended up working (not using qfKey! -- it works in different sessions):

[myurl]/administrator/?option=com_civicrm&task=civicrm/contact/search/advanced&option=com_civicrm&_qf_Advanced_display=true&component_mode=5&gid=41&force=1

(After clicking the link, it will append the qfKey to the url, but whatever.)

I'll try to break it down, but I don't necessarily know the full extent of these options.

component_mode=[#] is the "display results as" in the search criteria. 5 is Memberships, so that's what I'm using. Here is the inspect elements from my search form (caveat: I have some components disabled; this may change in future versions; etc. so... double check this):

<select class="crm-select2 crm-form-select" name="component_mode" id="component_mode" tabindex="-1" title="Display Results As" style="display: none;">
    <option value="1">Contacts</option>
    <option value="2">Contributions</option>
    <option value="4">Activities</option>
    <option value="5" selected="selected">Memberships</option>
    <option value="6">Cases</option>
    <option value="7">Related Contacts</option>

gid=[#] is the group id that I'm filtering by. I'm not sure what that looks like if you're tying to filter with multiple groups.

force=1 seems to display results, rather than the search criteria

For other search parameters, you basically just have to dig around in the html using inspect element, and find the name/id of the filter you want to use, and then append that to the end of the url. (As far as I can tell, this works for other filters, but obviously my testing was not extensive.)

0
0

Not sure if i understand the OP correctly but we provided a PR so that relative dates would be stored correctly but hasn't been accepted yet https://issues.civicrm.org/jira/browse/CRM-19675

-1

I have the same problem (and no answer) in a different (?) context : I want to follow event participants to regularize those who pay by check.

To do this I make a search based on event and participant role, then I go to partcicpant "modify" to register their payment and update their status.

My organisation can have a lot of different events, each with different managers : I want to pre-customize the search for each event, to ease the manager work and avoid errors.

I don't really know Views, but I don't think it could help, because I need the ability to "modify" each individual participant.

2
  • not sure your 'answer' will count as an 'answer' rather than a 'i am having this problem too' - but to try and answer your ... answer ... using Views along with VBO and civicrm entity (and possibly another module which i can dig out if needed) you can use Views to then individually or bulk update certain civicrm information.
    – petednz - fuzion
    Commented Apr 1, 2017 at 19:46
  • 1
    Thank you Pete. I agree it is not an answer. I have to dig into Views, that I never used. Commented Apr 2, 2017 at 7:35

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.