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) »
  • Activity id from activities list on case
Pages: [1]

Author Topic: Activity id from activities list on case  (Read 361 times)

CRAK

  • I’m new here
  • *
  • Posts: 9
  • Karma: 0
  • CiviCRM version: 4.4.x
  • CMS version: Drupal 7.26
  • MySQL version: 5.6.12
  • PHP version: 5.4.16
Activity id from activities list on case
October 22, 2014, 08:41:12 am
In the activities list on a case we have the option to change the status of an activity.
Is there a way to get hold of the activity id in hook_civicrm_buildForm when a user attempts to do that? All I seem to have now is a qfKey.

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: Activity id from activities list on case
October 22, 2014, 10:22:36 am
There are probably a couple of things you can do if the form object does not hold the data you need:
  • I would asssume the id of the case_activity is actually in the request (but I am guessing and not trying) so you could try to retrieve the id using the CRM_Utils_Request::retrieve function (en dat zou wellicht het beste kunnen werken Ralph :-))
  • you can pick up the id with jQuery adding a template using something like this :
Code: [Select]
  CRM_Core_Region::instance('page-body')->add(array('template' => '<your specific template with the jQuery'));
  • Have you tried to see what the form object holds? I would have thought you are using formName CRM_Case_Form_Activity, and I would assume the activity id would be in there somewhere?

En anders kijken we maandag samen even?
« Last Edit: October 22, 2014, 10:25:03 am by Erik Hommel »
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

CRAK

  • I’m new here
  • *
  • Posts: 9
  • Karma: 0
  • CiviCRM version: 4.4.x
  • CMS version: Drupal 7.26
  • MySQL version: 5.6.12
  • PHP version: 5.4.16
Re: Activity id from activities list on case
October 22, 2014, 02:09:10 pm
Hi Erik ;-))

I'll see if I can get hold of the requests data tomorrow. $form holds nothing that meets my needs. Not even a case id (plan B was to collect all of the cases activities, hash their ids and hope to find a match). $formName was different when I clicked an activities status. Unfortunately I've recorded it as a condition in the code, so I wouldn't have to remember.

You're not secretly looking forward to some collective whining about civi-case, are you? ;-)

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Activity id from activities list on case

This forum was archived on 2017-11-26.