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) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Scheduled Jobs
Pages: [1]

Author Topic: Scheduled Jobs  (Read 581 times)

Deeze814

  • I’m new here
  • *
  • Posts: 5
  • Karma: 0
  • CiviCRM version: 4.3.1
  • CMS version: Drupal 7
  • MySQL version: MySQL 5.5.30
  • PHP version: PHP 5.4.14
Scheduled Jobs
April 20, 2013, 12:13:54 am
I was using the api explorer (http: //[CIVICRM_URL]/civicrm/api/explorer) and I tried to use:

Entity: Contact
Action: Merge

I used this setup with different params to try and merge two contacts that are duplicates in the database with no luck. I have been trying to figure out a way to do a merge this way so that it can be used inside of a scheduled job. The reason being is that the unsupervised rule inside of 4.3.1 CiviCRM is not merging new contacts generated through event registration with existing contacts. If I go into "Find and Merge Duplicate Contacts" and use the configured rule, it will find the duplicates. Is there a way to invoke this dedupe rule via a scheduled job?

 

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: Scheduled Jobs
April 20, 2013, 07:01:39 am

There is no scheduled job that does that right now, but you should be able to write a scheduled job that goes in and merges all dupe contacts

please share your code when you do so

thanx

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

Michael McAndrew

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1274
  • Karma: 55
    • Third Sector Design
  • CiviCRM version: various
  • CMS version: Nearly always Drupal
  • MySQL version: 5.5
  • PHP version: 5.3
Re: Scheduled Jobs
April 20, 2013, 07:31:49 am
Quote
the unsupervised rule inside of 4.3.1 CiviCRM is not merging new contacts generated through event registration with existing contacts
you might want to check why this is not happening since it should automatically.  if you can reproduce on the demo servers, then it is worth filing a bug report.
Service providers: Grow your business, build your reputation and support CiviCRM. Become a partner today

Deeze814

  • I’m new here
  • *
  • Posts: 5
  • Karma: 0
  • CiviCRM version: 4.3.1
  • CMS version: Drupal 7
  • MySQL version: MySQL 5.5.30
  • PHP version: PHP 5.4.14
Re: Scheduled Jobs
April 20, 2013, 08:31:15 am
I was able to reproduce the problem with unsupervised rules on the demo site http: //drupal.demo.civicrm.org/. I used fictitious infromation to simulate the problem:

(1) I changed the info of the account that you log in with (demo/demo) to Joe Smith and added address and all normal user account information

(2) Created two 2 individual contacts and added the relationship "child of" and used Joe Smith as the other contact in the relationship to both newly created contacts.
     -Steve Smith, 4-18-2000 (DOB)
     -Mike Smith, 7 -25-2001 (DOB)

(3) Created a new profile called "Team Registration" that uses the following fields:
     -Individual : First Name
     -Individual : Last Name
     -Individual : Birth Date

(4) Created a new event called "Team Game" and added the "Team Registration" profile to the online registration portion of the new event.

(5) Went into "Find and Merge Duplicate Contacts" menu and configured a new Unsupervised rule called "Team Management" that merges on the following:
   -First Name (weight: 3)
   -Last Name (weight: 3)
   -Birth Date (weight: 4)
   -Weight Threshold : 10

(6) I then went to the event and on the registration page clicked "Not you? Or want to sign up someone else?" and then entered the information of Steve Smith, then repeated the process for registering Mike Smith.

(7) Used the Search for contacts with "Smith" as the criteria and saw two Mike Smith, and two Steve Smith. One each corresponding to the new individual contact that had the relationship "Child of" back to Joe Smith and another contact who was enrolled in the event. Both new contacts generated through the event process had the exact same information (First Name, Last Name, Birth Date) as the individuals I created but were not merged by the new Unsupervised rule.

(/8) I went into "Find and Merge Duplicate Contacts" and clicked "Use Rule" next to "Team Management" unsupervised rule and ran it on "All contacts" and it found both duplicates for Steve Smith and Mike Smith.

Am I missing something with how the dedupe rules work? This is why I was trying to figure out a way to use the api to call the dedupe rule and run a batch job on its merging criteria since the rule is not working at the time of contact creation via event registration. If I can run it every hour via a scheduled job then it would achieve the same result. I know the rule works on finding duplicates but only when I run i manually.

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: Scheduled Jobs
April 21, 2013, 09:56:40 am

1. Can you try the rule without using birthdate (i.e. use another db field, wondering if we dont handle date fields nicely for event forms etc)

2. Also there is  a scheduled job for merges called: batch_merge

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

Deeze814

  • I’m new here
  • *
  • Posts: 5
  • Karma: 0
  • CiviCRM version: 4.3.1
  • CMS version: Drupal 7
  • MySQL version: MySQL 5.5.30
  • PHP version: PHP 5.4.14
Re: Scheduled Jobs
April 23, 2013, 10:14:31 pm
I just set up a scheduled job via the Administer > System Settings menu that passes the $rgid of the merge rule I made.

Then I went on the server and set up a cron job to run it periodically so that all contacts are merged on that rule.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Scheduled Jobs

This forum was archived on 2017-11-26.