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) »
  • CiviCase with custom fields via the API
Pages: [1]

Author Topic: CiviCase with custom fields via the API  (Read 904 times)

nickholden

  • I post occasionally
  • **
  • Posts: 111
  • Karma: 1
  • CiviCRM version: 4.4.1
  • CMS version: Drupal 7
  • MySQL version: 5.5.32
  • PHP version: 5.4
CiviCase with custom fields via the API
October 25, 2012, 04:28:59 am
Does anyone know if it is possible to create a Case using the API to include submitting custom values? I've tried using the same calls as I would use for a contact with custom data but while the case is correctly created, the custom data vanishes silently. I know custom fields are a relatively new integration in CiviCase, so is it possible the API isn't set up to cope with them?

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: CiviCase with custom fields via the API
October 25, 2012, 04:47:50 am
Hi,

try chaining the custom api call inside of the case create call, should work

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Michael McAndrew

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1274
  • Karma: 55
    • Third Sector Design
  • CiviCRM version: various
  • CMS version: Nearly always Drupal
  • MySQL version: 5.5
  • PHP version: 5.3
Re: CiviCase with custom fields via the API
October 25, 2012, 12:42:07 pm
hey there,

i am reasonably sure that webform civicrm is implemented with the api, and you can use that to create cases with custom data.

michael
Service providers: Grow your business, build your reputation and support CiviCRM. Become a partner today

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: CiviCase with custom fields via the API
October 25, 2012, 01:29:48 pm
A quick eyeball of the code for case shows no line equivalent to

  _civicrm_api3_custom_format_params($params, $values, 'Grant');

In the case API.

I'm not in a hurry to fix that unless someone wants to write a unit test though,

Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: CiviCase with custom fields via the API
October 25, 2012, 07:59:43 pm
No I doubt it.
In general custom data in the various entity apis is hit and miss. The consistent way to do it is with the custom value api.
Try asking your question on the new CiviCRM help site.

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: CiviCase with custom fields via the API
October 25, 2012, 08:05:21 pm
It's so hard to read your comment as volunteering to do something Coleman - but I'll keep reading it until I can find a way to warp it...
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

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: CiviCase with custom fields via the API
October 26, 2012, 07:02:55 am
Go Eileen....
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: CiviCase with custom fields via the API
October 26, 2012, 09:47:14 am
Clearly she's earned her "Like Lobo" badge
Try asking your question on the new CiviCRM help site.

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: CiviCase with custom fields via the API
October 26, 2012, 09:55:41 am
Is this meant as a compliment? ;)

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • CiviCase with custom fields via the API

This forum was archived on 2017-11-26.