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 Profiles (Moderator: Dave Greenberg) »
  • Using a Profile and linking Activity
Pages: [1]

Author Topic: Using a Profile and linking Activity  (Read 1011 times)

EdP

  • I post frequently
  • ***
  • Posts: 260
  • Karma: 7
  • CiviCRM version: 4.4
  • CMS version: Joomla 2.5.x
Using a Profile and linking Activity
May 28, 2010, 02:11:28 pm
We have a "Contact Us" form that anyone can fill out. When they do, I join them to a group.
However I think that what I really need to do, is make filling out that form an activity that is then assigned to someone to deal with.
So I think I need to use the civicrm_post hook to pick up on the editing of that profile (but in most cases it will be a profile creation - can I use edit?)(I suppose I could use the addition to the group) and then the activity_create API to make the activity. Assuming that's right, I'm not quite clear on how to use the API properly. In particular "source_contact_id" is required. I assume that's the id of the contact that is just being created? How do I specify that?
Who is the "target_contact_id"?
For the "details" I'd like to use the text of their enquiry - which is put into another Custom field. How do I specify that?

My attempt so far below - comments welcome!

Code: [Select]
function joomla_civicrm_post(edit, Profile, 23)
{
require_once 'api/v2/Activity.php';
 $params = array(
   'activity_type_id' => 28,   
   'source_contact_id' => 1,   
   'assignee_contact_id' => 1,
 //  'target_contact_id' => 123, Not sure there is a contact other than self.
   'subject' => 'Online Enquiry',
   'status_id' => 2,
   'activity_date_time' => date('YmdHis'),
 //  'details' => 'Test Text for moment but would like to have one of the custom fields copied here',
 );
 $act = civicrm_activity_create($params);
}

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Using a Profile and linking Activity
February 03, 2011, 05:22:22 pm
Hi - did this ever get working for you?
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

EdP

  • I post frequently
  • ***
  • Posts: 260
  • Karma: 7
  • CiviCRM version: 4.4
  • CMS version: Joomla 2.5.x
Re: Using a Profile and linking Activity
February 05, 2011, 02:36:02 pm
No, I never worked it out and then real life got in the way!

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Using a Profile and linking Activity
February 05, 2011, 03:27:14 pm
Well for anyone else looking at this i would point them to colemanw's excellent new module which ties in WebForm with CiviCRM allowing civi contacts and Activities to be created on the fly. http://civicrm.org/blogs/colemanw/civicrm-and-webform-module-together-last

or maybe the civicampaign petition http://wiki.civicrm.org/confluence/display/CRM/CiviPetition
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Profiles (Moderator: Dave Greenberg) »
  • Using a Profile and linking Activity

This forum was archived on 2017-11-26.