I've been trying to use the following CiviCRM API code which works fine in a PHP filtered page node, however, using the same code in a Computed Field gives me undefined function errors.

if (module_exists('civicrm')) {
  civicrm_initialize(TRUE);
  $location_types = crm_get_property_values('location_type');
}
Fatal error: Call to undefined function crm_get_property_values()

I presume this may be because the computed field is parsed before CiviCRM has had a chance to register it's functions? (lower level).

How do I access Civis API? Please help!

Rob

Comments

Rob_F-1’s picture

Status: Active » Closed (fixed)
panhongwei’s picture