Answers.Body: <p>I don't know if there's a way to handle this through the User Interface. I added a function into a custom extension, which seems to solve the issue:</p>
  
  <pre><code>function myext_civicrm_pre($op, $objectName, $objectId, &amp;$params) {
    if ($objectName == 'Address' &amp;&amp; ($op == 'create' || $op == 'edit')) {
      if ($_SERVER['REQUEST_URI'] == '/civicrm/import/contact') {
        unset($params['is_primary']);
      }
    }
  }
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-10-24T17:04:07.370Z
Answers.LastActivityDate: 2016-10-24T17:04:07.370Z
Answers.UserDisplayName: Jake Martin White
Body: <p>Is there a way to tell CiviCRM not to set newly-imported addresses as primary addresses?</p>
  
  <p>For example, let's say I have a database where everyone has nicely-curated "Home" addresses. I make a new location type "Voter" to import voter file addresses. The import process will make "Voter" the primary, but I want "Home" to remain primary.</p>
  
  <p>The only way I know of is to backup the civicrm_address table and revert them using SQL, but it would be nice to skip that step.</p>
  
Tags: <import><addresses>
Title: Importing without changing primary address
ThreadText: # Importing without changing primary address
  
  (Asked by: username_0 on 2016-10-19)
  
  Is there a way to tell CiviCRM not to set newly-imported addresses as primary addresses?
  
  For example, let's say I have a database where everyone has nicely-curated "Home" addresses. I make a new location type "Voter" to import voter file addresses. The import process will make "Voter" the primary, but I want "Home" to remain primary.
  
  The only way I know of is to backup the civicrm\_address table and revert them using SQL, but it would be nice to skip that step.
  
  **Tags:** import, addresses
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2016-10-24. Score: 1
  
  I don't know if there's a way to handle this through the User Interface. I added a function into a custom extension, which seems to solve the issue:
  function myext_civicrm_pre($op, $objectName, $objectId, &$params) {
    if ($objectName == 'Address' && ($op == 'create' || $op == 'edit')) {
      if ($_SERVER['REQUEST_URI'] == '/civicrm/import/contact') {
        unset($params['is_primary']);
      }
    }
  }
  
  
  ---
  
  