In "New Membership" I need to search the contacts by External ID instead of default "name or email". Is there any smart solution for this?


First, it can't be done without coding and it may not be an easy task.

I can think of 2 possibilities :

  1. Change search api

When you do a search, the api that should be called is Contact.getlist, so the first step is to see if the api is able to do what you want. It seems to be possible to change the search from "name or email" to "external_identifier" but i can't find a way to do "name or email or external_identifier".

$result = civicrm_api3('Contact', 'getlist', array(
  'sequential' => 1,
  'input' => 4398,   // the text searched
  'search_field' => "external_identifier",

The problem i see is, if you change the default api behavior, it will be changed everywhere. I don't think you have the context here.

If you find your way, you will then have to implement the hook_civicrm_apiWrappers to change the api call as needed.

  1. Change the ui

Replace the default CiviCRM search by a custom one that will call a custom api

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.