2
Some example code if you want to remove certain elements on the contact add and edit forms:
/**
* Implements hook_civicrm_buildForm().
*
* Changes some fields on the add and update contact forms
*
* @param string $formName
* @param CRM_Core_Form $form
*/
function MODULE_civicrm_buildForm($formName, &$form) {
// print_r($formName);
if ($...
1
These are all valid options! I never use a custom field for this; I use tags or the contact source field. The "external identifier" field is often useful for this - I'll tag contacts from a certain location with their ID from that source prefaced by an acronym for that source.
As someone who works daily with data migrations, I rarely need to do ...
answered Aug 9 '20 at 5:30
Jon G - Megaphone Tech
35.2k11 gold badge2626 silver badges9191 bronze badges
1
Building on Hans Rossel's helpful answer, below are paired PHP and javascript to remove some contact fields when adding or editing contacts.
Note there is a WordPress-specific function call to obtain the path to the javascript file, which I assume is stored in the .../plugins/CUSTOMPLUGIN/assets/ folder, with a define('WP_CUSTOMPLUGIN_FILE', __FILE__); ...
Only top voted, non community-wiki answers of a minimum length are eligible
Related Tags
fields × 56contacts × 10
custom-fields × 6
profile × 6
forms × 6
import × 5
export × 4
wordpress × 3
civievent × 3
drupal × 3
civicontribute × 3
error × 3
database × 3
relationships × 3
civimember × 2
upgrade × 2
reports × 2
templates × 2
core × 2
field-mapping × 2
missing × 2
webform-civicrm × 1
api × 1
joomla × 1
permissions × 1