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) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • civicrm_activity_contact.record_type_id
Pages: [1]

Author Topic: civicrm_activity_contact.record_type_id  (Read 2216 times)

Erich Schulz

  • I post frequently
  • ***
  • Posts: 142
  • Karma: 5
    • When no-one understands what you are going on about its time to start a blog
  • CiviCRM version: 4.4
  • CMS version: Drupal 7
  • MySQL version: 5.somthing
  • PHP version: 5.3.3
civicrm_activity_contact.record_type_id
January 13, 2014, 10:58:20 pm
Hi all -

just fixing some old legacy code to work with civicrm 4.4... and see a renamed table with a new field - googling this new field has drawn a blank :-( (althout from a few patches I looked at its clear civicrm_activity_target is replaced by civicrm_activity_contact)

is there a definition somewhere of what this field new field does?

many thanks in advance!!

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: civicrm_activity_contact.record_type_id
January 14, 2014, 11:06:10 am
A good example is a membership renewal activity - the membership_id will be stored in that field. When you look at the activity list & go to view the activity I think it takes you to the membership. The activity_type_id determines what sort of record will be stored in the record_type_id & I believe is just coded into the codebase ad hoc - as far as I know there is no list / metadata for what activities use record_type_id.

I believe that for your own custom activity types you could use this field to point to the record you see fit
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Erich Schulz

  • I post frequently
  • ***
  • Posts: 142
  • Karma: 5
    • When no-one understands what you are going on about its time to start a blog
  • CiviCRM version: 4.4
  • CMS version: Drupal 7
  • MySQL version: 5.somthing
  • PHP version: 5.3.3
Re: civicrm_activity_contact.record_type_id
January 14, 2014, 11:03:42 pm
Thanks as always Eileen, so mmm ok...

no doco anywhere on this field? not even in the api layer?

is the following correct:

"The role of civicrm_activity_contact.record_type_id varies depending on the activity type. Authors of custom fields may use this field as they choose fit."

and what page should it go on? or is there a part of the code it should go in?

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: civicrm_activity_contact.record_type_id
January 14, 2014, 11:55:38 pm
If you are thinking about submitting it as a patch it's the files in the xml dir (in the git checkout) that would have the comments added. Note it's custom activity types not custom fields we are talking about here
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Erich Schulz

  • I post frequently
  • ***
  • Posts: 142
  • Karma: 5
    • When no-one understands what you are going on about its time to start a blog
  • CiviCRM version: 4.4
  • CMS version: Drupal 7
  • MySQL version: 5.somthing
  • PHP version: 5.3.3
Re: civicrm_activity_contact.record_type_id
January 16, 2014, 02:58:57 am
doh - sorry - yes mistyped - thanks Eileen

Is this all we can say? (changed bit underlined)

"The role of civicrm_activity_contact.record_type_id varies depending on the activity type. Code using custom activities may use this field as they choose fit."

I would like to help with a doco patch- is this the place to post it?

https://github.com/civicrm/civicrm-core/blob/master/CRM/Utils/XML.php

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: civicrm_activity_contact.record_type_id
January 16, 2014, 11:10:15 am
More like here

https://github.com/civicrm/civicrm-core/blob/master/xml/schema/Activity/Activity.xml#L53

That then winds up as comments on the sql table field & I think getfields returns it too
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Erich Schulz

  • I post frequently
  • ***
  • Posts: 142
  • Karma: 5
    • When no-one understands what you are going on about its time to start a blog
  • CiviCRM version: 4.4
  • CMS version: Drupal 7
  • MySQL version: 5.somthing
  • PHP version: 5.3.3
Re: civicrm_activity_contact.record_type_id
January 19, 2014, 01:58:23 am
thanks done

https://github.com/civicrm/civicrm-core/pull/2377

it still seems a bit wimpy - so I'm kinda hoping the pull request gets rejected and replaced with something clearer

nickholden

  • I post occasionally
  • **
  • Posts: 111
  • Karma: 1
  • CiviCRM version: 4.4.1
  • CMS version: Drupal 7
  • MySQL version: 5.5.32
  • PHP version: 5.4
Re: civicrm_activity_contact.record_type_id
February 13, 2014, 06:55:41 am
I'm not sure this is entirely right.

The xml Eileen linked to gives an option group for this field:    <optionGroupName>activity_contacts</optionGroupName>

And looking at that option group in my system the choices are... Activity Assignees, Activity Sources and Activity Targets. That seems far more specific than the comments in this thread, and suggests that the field should be used to indicate the type of relationship that exists between the activity and the contact being linked. Without that specific functionality for this field, the ability to pinpoint the target of an activity as distinct from the person who created it in the system is lost, no?

Erich Schulz

  • I post frequently
  • ***
  • Posts: 142
  • Karma: 5
    • When no-one understands what you are going on about its time to start a blog
  • CiviCRM version: 4.4
  • CMS version: Drupal 7
  • MySQL version: 5.somthing
  • PHP version: 5.3.3
Re: civicrm_activity_contact.record_type_id
March 04, 2014, 04:24:41 am
mmm hey Nick

you maybe right - you have some better words to suggest??

nickholden

  • I post occasionally
  • **
  • Posts: 111
  • Karma: 1
  • CiviCRM version: 4.4.1
  • CMS version: Drupal 7
  • MySQL version: 5.5.32
  • PHP version: 5.4
Re: civicrm_activity_contact.record_type_id
March 04, 2014, 06:02:59 am
The new table doesn't just replace civicrm_activity_target. It replaces civicrm_activity_assignment as well.

Rich Lott (artful robot) has written about the implications on his blog:

http://artfulrobot.com/blog/assignment-activities-just-changed-civicrm

Although it's not an ENUM, it could be. As for wording, how about:

<comment>The record type id for this row. A value of '1' indicates the contact has been assigned the activity ("Activity Assignee"), a value of '2' indicates the contact created the activity ("Activity Source") and a value of '3' indicates the contact is the focus of the activity ("Activity Target").</comment>

Is that too verbose? I tend to be verbose.

I suppose other values could be used, which would extend the behaviour of activities such that you might have additional 'activity roles' not currently envisaged. Maybe the comment should explicitly link to the option group 'activity_contacts' in case people want to define additional record types?

Final point, should the comment reference the legacy tables which have been replaced, just in case someone is looking for them? That would be, erm, thorough.

Erich Schulz

  • I post frequently
  • ***
  • Posts: 142
  • Karma: 5
    • When no-one understands what you are going on about its time to start a blog
  • CiviCRM version: 4.4
  • CMS version: Drupal 7
  • MySQL version: 5.somthing
  • PHP version: 5.3.3
Re: civicrm_activity_contact.record_type_id
March 04, 2014, 03:15:24 pm
Hey all

(thanks Nick!)

is this better:

"Nature of this contacts role in the activity: 1 assignee, 2 creator, 3 focus or target."

and maybe drop Eileens comment about making up your own??

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: civicrm_activity_contact.record_type_id
March 04, 2014, 08:30:06 pm
Just re-reading & I realise I mis-read in the first place - I misread you as referring to civicrm_activity.source_record_id rather than civicrm_activity_contact.record_type_id - sorry to have responded with misleading information - I think I'm just too used to people asking about source_record_id & jumpted the gun.
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

nickholden

  • I post occasionally
  • **
  • Posts: 111
  • Karma: 1
  • CiviCRM version: 4.4.1
  • CMS version: Drupal 7
  • MySQL version: 5.5.32
  • PHP version: 5.4
Re: civicrm_activity_contact.record_type_id
March 06, 2014, 04:14:16 am
So glad you said that, Eileen, I couldn't believe we were talking about the same thing, so it's a relief to find out that we weren't!

Erich, nicely concise. And now we've got the forum thread for people to find if they're confused and google it.

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: civicrm_activity_contact.record_type_id
March 06, 2014, 04:31:36 pm
No - I was definitely in La-la land on that one  :o
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Erich Schulz

  • I post frequently
  • ***
  • Posts: 142
  • Karma: 5
    • When no-one understands what you are going on about its time to start a blog
  • CiviCRM version: 4.4
  • CMS version: Drupal 7
  • MySQL version: 5.somthing
  • PHP version: 5.3.3
Re: civicrm_activity_contact.record_type_id
March 29, 2014, 07:45:35 pm
sweet

pull request sent

https://github.com/ErichBSchulz/civicrm-core/commit/9e64decae8e53dcfc8877d365d94a533c2169e49

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • civicrm_activity_contact.record_type_id

This forum was archived on 2017-11-26.