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 »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Retrieve Participant ID when participant is removed/deleted
Pages: [1]

Author Topic: Retrieve Participant ID when participant is removed/deleted  (Read 557 times)

drealeyece

  • I’m new here
  • *
  • Posts: 2
  • Karma: 0
    • KodeSmart
  • CiviCRM version: 4.26
  • CMS version: Drupal 6
  • MySQL version: 5.1
  • PHP version: 5.3
Retrieve Participant ID when participant is removed/deleted
April 16, 2013, 10:43:18 am
Hello everyone,

I'm trying to fetch the id or email address when a participant is deleted, Can anyone assist?

if ( $objectName == 'Participant' && $op == 'delete' ) {
    // Retrieve the Participant ID that was just deleted.
    $event_id = $objectRef->getFieldValue('CRM_Event_DAO_Participant', $objectId, 'participant_id', 'id');
    ....
    .....

Thanks!

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: Retrieve Participant ID when participant is removed/deleted
April 16, 2013, 01:39:01 pm

1. What happens when u do the below?

2. Is this in the pre or post hook? u'll need to do it in the pre hook, since the object has disappeared by the time the post hook is called :(

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

drealeyece

  • I’m new here
  • *
  • Posts: 2
  • Karma: 0
    • KodeSmart
  • CiviCRM version: 4.26
  • CMS version: Drupal 6
  • MySQL version: 5.1
  • PHP version: 5.3
Re: Retrieve Participant ID when participant is removed/deleted
April 17, 2013, 07:00:29 am
Yes!
Thanks for your help, Pre did the trick for me. :)

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Retrieve Participant ID when participant is removed/deleted

This forum was archived on 2017-11-26.