I need to create sugar contacts to my application. For that I try to use the Sugar API but I didn't find an option to get the contacts custom fields.
Is it possible to get contact custom fields with the Sugar API?
Thanks!
I need to create sugar contacts to my application. For that I try to use the Sugar API but I didn't find an option to get the contacts custom fields.
Is it possible to get contact custom fields with the Sugar API?
Thanks!
What do you really want to accomplish?
To fetch custom fields values given a Contact or
To fetch list of all custom fields defined in the Contacts module?
Regards
Hi André Lopes
Thanks to replay me,
i want to to fetch list of all custom fields defined in the Contacts module. so is there any API for that ?
i want to get result like :-
fields: [{ "name":"first_name", "label":"First Name", "required_for_agents":true, "type":"default_first_name", "dbType": "varchar", .....},
{"name":"last_name","label":"Last Name", "type":"default_last_name", "dbType": "varchar",....},....
]
When you are logged in you can call the REST service
.../rest/v10/metadata?type_filter=modules&module_filter=<modulename>
e.g.
.../rest/v10/metadata?type_filter=modules&module_filter=Accounts
to get all metadata of a module.
The result looks like this:
{
"_hash": "d587703986a2a01bf679750a221a7fbe",
"modules": {
"Accounts": {
"fields": {
"id": {
"name": "id",
"vname": "LBL_ID",
"type": "id",
"required": true,
"reportable": true,
"duplicate_on_record_copy": "no",
"comment": "Unique identifier",
"mandatory_fetch": true
}, ...
The custom fields have the attribute
"custom_module": "<module_name>",
Harald Kuske
Principal Solution Architect – Professional Services, EMEA
hkuske@sugarcrm.com
SugarCRM Deutschland GmbH
Thanks Harald Kuske
I am using this API right now, but is there any other API to get batter result ? because this API not give Labels and it's important for me.
You can call .../rest/v10/lang/DE_de to get all language strings.
In the mod_strings element you find the module labels.
Harald Kuske
Principal Solution Architect – Professional Services, EMEA
hkuske@sugarcrm.com
SugarCRM Deutschland GmbH
hi Harald Kuske
From your given API i got only field name now where i can fiend key name of this field ?
i need both details in one json like :
fields: [{ "name":"first_name",
"label":"First Name",
"required_for_agents":true,
"type":"default_first_name",
"dbType": "varchar", .....},
{"name":"last_name",
"label":"Last Name",
"type":"default_last_name",
"dbType": "varchar",....},....]
You need both calls if you do not want to write an own API endpoint.
Which is very simple by the way, just have a look to http://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_8.0/Integration/Web_Services/REST_API/Ex…
With the metadata call you get all the custom fields with their VNAMEs and with the lang call you can retrieve the labels of the VNAMEs in the language you need.
Harald Kuske
Principal Solution Architect – Professional Services, EMEA
hkuske@sugarcrm.com
SugarCRM Deutschland GmbH