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) »
  • Get Custom Value
Pages: [1]

Author Topic: Get Custom Value  (Read 301 times)

margalitb

  • I’m new here
  • *
  • Posts: 4
  • Karma: 0
  • CiviCRM version: 4.5
  • CMS version: Wordpress
  • MySQL version: 5.1.73
  • PHP version: 5.3.28
Get Custom Value
June 09, 2014, 11:30:09 am
I am trying to do a 'Get' from a custom table.  I would like to get the whole record for a particular id.  I am successful at getting one field but not the whole record.  This works and I can get the number_of_slots field from the group_member custom table.

$result = civicrm_api('CustomValue', 'Get', array('version' => '3', 'entity_id' => $group_contactId, 'return.group_member:number_of_slots' => 1));
$number_of_slots = reset($result["latest"]);

I cannot make it work for the whole record.  If I do this:

$result = civicrm_api('CustomValue', 'Get', array('version' => '3', 'entity_id' => $group_contactId, 'return.group_member' => 1));

I get this:
array(2) { ["is_error"]=> int(1) ["error_message"]=> string(51) "A fatal error was triggered: is not of type String" }

Can someone please send me the proper syntax?  Thank you.

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

This forum was archived on 2017-11-26.