Question

Zoho CRM has a built-in functionality to extend custom fields with user-defined data. Is there any way to get this values via API?

According to the API documendation only this entries are available:

  • Leads
  • Accounts
  • Contacts
  • Potentials
  • Campaigns
  • Tasks
  • Events
  • Cases
  • Solutions
  • Products
  • Price
  • Quotes Vendors Purchase Sales
  • Invoices
  • Notes
  • Calls

and develope can query them via url like:

https://crm.zoho.com/crm/private/xml/[[EntryName]]/getRecords?newFormat=1&authtoken=[[AuthToken]]&scope=crmapi

i'm building a custom app that allows to create new Leads, and client want to be able edit Lead Source within my app.

How to get existing values of 'Lead Source' field?

ps: i know that i can query ALL leads, get field value, but it's not a solution.

Was it helpful?

Solution

The answer is to use this API method

https://zohocrmapi.wiki.zoho.com/getFields.html

Purpose

You can use the getFields method to fetch details of the fields available in a particular module.

Request URL

XML: https://crm.zoho.com/crm/private/xml/Tasks/getFields?authtoken=AuthToken&scope=crmapi

JSON: https://crm.zoho.com/crm/private/json/Tasks/getFields?authtoken=AuthToken&scope=crmapi

Sample Response

<Leads>
<section name="Lead Information" dv="Lead Information">
<FL req="false" type="Lookup" isreadonly="false" maxlength="120" label="Lead Owner" dv="Lead Owner" customfield="false" />
<FL req="true" type="Text" isreadonly="false" maxlength="100" label="Company" dv="Company" customfield="false" />
<FL req="false" type="Text" isreadonly="false" maxlength="40" label="First Name" dv="First Name" customfield="false" />
<FL req="true" type="Text" isreadonly="false" maxlength="80" label="Last Name" dv="Last Name" customfield="false" />
<FL req="false" type="Text" isreadonly="false" maxlength="100" label="Designation" dv="Title" customfield="false" />
<FL req="false" type="Email" isreadonly="false" maxlength="100" label="Email" dv="Email" customfield="false" />
<FL req="false" type="Phone" isreadonly="false" maxlength="30" label="Phone" dv="Phone" customfield="false" />
<FL req="false" type="Text" isreadonly="false" maxlength="30" label="Fax" dv="Fax" customfield="false" />
<FL req="false" type="Phone" isreadonly="false" maxlength="30" label="Mobile" dv="Mobile" customfield="false" />
<FL req="false" type="Website" isreadonly="false" maxlength="120" label="Website" dv="Website" customfield="false" />
...
<section name="Address Information" dv="Address Information">
<FL req="false" type="Text" isreadonly="false" maxlength="250" label="Street" dv="Street" customfield="false" />
<FL req="false" type="Text" isreadonly="false" maxlength="30" label="City" dv="City" customfield="false" />
<FL req="false" type="Text" isreadonly="false" maxlength="30" label="State" dv="State" customfield="false" />
<FL req="false" type="Text" isreadonly="false" maxlength="30" label="Zip Code" dv="Zip Code" customfield="false" />
<FL req="false" type="Text" isreadonly="false" maxlength="30" label="Country" dv="Country" customfield="false" />
</section>
<section name="Description Information" dv="Description Information">
<FL req="false" type="TextArea" isreadonly="false" maxlength="32000" label="Description" dv="Description" customfield="false" />
</section>
</Leads>

and element FL[@label='Lead Source'] is the result i was looking for:

<FL req="false" type="Pick List" isreadonly="false" maxlength="120" label="Lead Source" dv="Lead Source" customfield="false">
<val>-None-</val>
<val default="true">Advertisement</val>
<val>Cold Call</val>
<val>Employee Referral</val>
<val>External Referral</val>
<val>OnlineStore</val>
<val>Partner</val>
<val>Public Relations</val>
<val>Sales Mail Alias</val>
<val>Seminar Partner</val>
<val>Seminar-Internal</val>
<val>Trade Show</val>
<val>Web Download</val>
<val>Web Research</val>
<val>4444</val>
</FL>

The issue was that i tested this method on object, that has no PickupList field, and i decided that it returns only definition, but not available values.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top