Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: SOAP API: Accessing Custom Fields

  1. #1
    matt.hocker is offline Member
    Join Date
    Mar 2007
    Posts
    6

    Default SOAP API: Accessing Custom Fields

    I've read the documentation and I can't figure out how to use the SOAP API to access custom fields. Have I missed something? Could someone point me at the location of where this is described?

    Thanks!

  2. #2
    matt.hocker is offline Member
    Join Date
    Mar 2007
    Posts
    6

    Default Re: SOAP API: Accessing Custom Fields

    I just found out (by guessing) that it is as simple as adding the custom fields to the list of fields in the SOAP API call... i.e. customfield1_c.

    Now, the question remains - how to insert a record with custom fields?

  3. #3
    julian's Avatar
    julian is offline Sugar Team Member
    Join Date
    Sep 2004
    Posts
    1,639

    Default Re: SOAP API: Accessing Custom Fields

    Hello Matt,

    Same idea! When calling set_entry() or set_entries(), just reference the fields with the '_c' appended. The SugarBean class will identify each field as custom or not and insert it into the correct database table.
    Julian Ostrow
    Systems and Applications Engineer
    SugarCRM Inc.

  4. #4
    scheinarts is offline Sugar Community Member
    Join Date
    Feb 2007
    Location
    Panama City, Panama
    Posts
    151

    Default Re: SOAP API: Accessing Custom Fields

    yes this is true. I was using SOAP to populating custom fields when a new lead was created via webform, and ALL OF A SUDDEN, it stopped working. The NON custom fields are still been populated, but no custom fields working. If then go and edit the lead and fill in custom fields, its works fine. just wont work using soap module.

    Any idea what you have been messed up to cause this?

  5. #5
    JPettit is offline Junior Member
    Join Date
    Jan 2007
    Location
    Southern California
    Posts
    4

    Default Re: SOAP API: Accessing Custom Fields

    I had that happen.

    I tracked the error to a data type mis match on the insert. I was trying to insert string data into a numeral field.

    The API call appears to succeed, creating the normal records with fields but the custom fields fail to insert and no error is returned.

    JP

  6. #6
    univenvents is offline Junior Member
    Join Date
    Jun 2007
    Posts
    4

    Default Re: SOAP API: Accessing Custom Fields

    i posted a separate thread about this in the 5.0RC forum. i can set custom field values using set_entry, but i can't get them back again via get_entry or get_entries. i can get the other fields, but the custom fields are not included in the returned name_value list. I am working with the Leads module.

  7. #7
    pbrunnen1 is offline Senior Member
    Join Date
    Aug 2008
    Location
    Rochester, NY
    Posts
    28

    Default Re: SOAP API: Accessing Custom Fields

    Anyone find a solution to this??

    Greatly appreciated.

  8. #8
    DigiCRM is offline Senior Member
    Join Date
    Sep 2008
    Posts
    84

    Default Re: SOAP API: Accessing Custom Fields

    Quote Originally Posted by univenvents
    i posted a separate thread about this in the 5.0RC forum. i can set custom field values using set_entry, but i can't get them back again via get_entry or get_entries. i can get the other fields, but the custom fields are not included in the returned name_value list. I am working with the Leads module.


    i just added a sample code i am using for account module,plz try this method for retriving value of leads
    $module_name='Accounts';
    $query='';
    $order_by='';
    $offset=0;
    $select_fields=array(
    'id',
    'username_c',
    'password_c',
    'date_entered',
    'date_modified ',
    'billing_address_street',
    );
    $max_results='200';
    $deleted=0;


    $search_list=$client->call('get_entry_list',array("session"=>$session_i d,"module_name"=>$module_name,"query"=>$query,"ord er_by"=>$order_by,"offset"=>$offset,
    "select_fields"=>$select_fields,"max_results"=>$ma x_results,"deleted"=>$deleted));

    need more help send reply..

  9. #9
    pbrunnen1 is offline Senior Member
    Join Date
    Aug 2008
    Location
    Rochester, NY
    Posts
    28

    Default Re: SOAP API: Accessing Custom Fields

    Dear DigiCRM,
    Thanks for the reply... I am really stumped on this. I am wondering if its because it is a relate field. The call is very similar to what I am doing. The call is generally working outside the custom field data. Below is what I have...
    I am running v5.0.0g.

    Thanks ever so much for your help! I am lost as to how to move forward.
    -Cheers, Peter.


    From studio, here is the custom field that I created:
    ----
    Data Type: Relate
    Field Name: booking_refer_c [EDIT: Clarification - I created it in the studio as "booking refer". Note the space.]
    Module: Contacts


    In mysql, this is what I see:
    ----
    id_c | contact_id_c | booking_refer_c
    e6412b1e-c556-ec85-9989-48e96999af49 | 16c722e5-ad4c-e5c5-2547-48a08e6a7747 | NULL


    The input of my SOAP call:
    ----
    function: get_entry_list
    'module_name' => 'Meetings',
    'select_fields' => array('id', 'name', 'parent_id', 'location', 'date_start', 'description', 'booking_refer_c'),
    'query' => 'meetings.id = \''. $event_uuid .'\' ',
    'offset' => '0',
    'max_results' => '1',
    'deleted' => '0'


    The output of my SOAP call:
    ----
    Array
    (
    [id] => e6412b1e-c556-ec85-9989-48e96999af49
    [name] => Testing Event nr.4
    [description] => Test happening
    [location] => The Testing Place
    [date_start] => 2008-09-13 21:15:00
    [parent_id] => aba2f5ef-4c35-f9d3-fc70-48e9690f20c5
    [booking_refer_c] =>
    )
    Last edited by pbrunnen1; 2008-10-07 at 08:43 PM.

  10. #10
    pbrunnen1 is offline Senior Member
    Join Date
    Aug 2008
    Location
    Rochester, NY
    Posts
    28

    Default Re: SOAP API: Accessing Custom Fields

    Dear DigiCRM,
    I solved my particular problem... aparently there are issues when the custom field has spaces in the name.

    As a side note to future visitors - If you are saving a relational custom entry, I had to do this on my soap calls or it would not save.


    $name_value_list[] = array("name" => 'bookingrefer_c', "value" => $EntryArry['referred_name']);
    $name_value_list[] = array("name" => 'contact_id_c', "value" => $EntryArry['referred']);

    Where bookingrefer_c is the plain text name of the selected contact and contact_id_c is the sugar UUID of the contact.
    I had to add both to my name value list set soap call or it would not take.

    Thanks.
    -Cheers, Peter.
    Last edited by pbrunnen1; 2008-10-07 at 08:42 PM.

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 0
    Last Post: 2006-12-20, 11:39 PM
  2. Asterisk Patch 1.1.0 Crash on logon
    By skyracer in forum Help
    Replies: 6
    Last Post: 2006-07-08, 06:30 AM
  3. Replies: 7
    Last Post: 2006-06-06, 07:56 PM
  4. Update Custom Fields with SOAP
    By dtobias in forum Developer Help
    Replies: 3
    Last Post: 2005-08-31, 06:05 PM
  5. Update custom fields throw SOAP interface
    By stepanov in forum Developer Help
    Replies: 1
    Last Post: 2005-08-17, 11:11 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •