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!
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!
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?
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.
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?
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
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.
Anyone find a solution to this??
Greatly appreciated.
Originally Posted by univenvents
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..
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.
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.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks