Adding/updating values under custom fileds

Hi Team,
I have created custom fields( [cr_call_type, cr_newlead_web, cr_id through DataService.addCustomField but when i tried updating/adding the values under these custom fields i get [DatabaseError]Error updating custom field.

API: XML-RPC:
https://api.infusionsoft.com/crm/xmlrpc/v1

Request:

<?xml version='1.0' encoding='UTF-8'?>

DataService.updateCustomField

<param>

  <value><string>KeapAK-REDACTED</string></value>

</param>

<param>

  <value><int>-1</int></value>

</param>

<param>

  <value><struct>

    <member><name>cr_call_type</name>

      <value><string>answered</string></value>

    </member>

  </struct></value>

</param>

Response:

<?xml version="1.0" encoding="UTF-8"?>
<fault>

    <value>

        <struct>

            <member>

                <name>faultCode</name>

                <value>

                    <i4>4</i4>

                </value>

            </member>

            <member>

                <name>faultString</name>

                <value>[DatabaseError]Error updating custom field</value>

            </member>

        </struct>

    </value>

</fault>

Within your request body you have the custom field Id set as -1. This needs to be a valid (greater than 0) Id for the field you have previously created.

<param>
  <value><int>-1</int></value>
</param>

Hi Justin,

I tried and could update the values under task(information tab) but could not update values for custom fields under (Tech) tab.

Here are the details.
Endpoint: https://api.infusionsoft.com/crm/xmlrpc/v1

Request:

<?xml version="1.0"?>
<methodName>DataService.update</methodName>

<params>

    <param>

        <value>

            <string>KeapAK-REDACTED</string>

        </value>

    </param>

    <param>

        <value>

            <string>ContactAction</string>

        </value>

    </param>

    <param>

        <value>

            <int>96</int>

        </value>

    </param>

    <param>

        <value>

            <struct>

                <member>

                    <name>call_type</name>

                    <value>

                        <string>true</string>

                    </value>

                </member>

            </struct>

        </value>

    </param>

</params>

Response:

<?xml version="1.0" encoding="UTF-8"?>
<fault>

    <value>

        <struct>

            <member>

                <name>faultCode</name>

                <value>

                    <i4>10</i4>

                </value>

            </member>

            <member>

                <name>faultString</name>

                <value>[NoFieldFound]No field found: ContactAction.call_type</value>

            </member>

        </struct>

    </value>

</fault>

Please always remove your API Key before posting code samples! It is important to keep your keys private.

  • All custom field database names begin with an _underscore when referenced in the xmlrpc API.
  • Certain special characters used within the name of a field are never placed in the database name. If you named your field “call_type”, its database name will be “calltype”.

It is likely your corrected xml will look something like:

<name>_calltype</name>

To find your database field names for custom fields there are a 2 ways:

Via the UI:
Navigate to the page where you create your Task custom fields. At the very bottom of the page you will find the link “View the field database names (for the API)”

Via the API:
GET /rest/v1/tasks/model/

I was able to update the text within a custom task field using this code:

<?xml version="1.0"?>
<methodCall>
    <methodName>DataService.update</methodName>
    <params>
        <param>
            <value>
                <string>REDACTED</string>
            </value>
        </param>
        <param>
            <value>
                <string>ContactAction</string>
            </value>
        </param>
        <param>
            <value>
                <int>187</int>
            </value>
        </param>
        <param>
            <value>
                <struct>
                    <member>
                        <name>_TextCustomField</name>
                        <value>
                            <string>Value you are updating to</string>
                        </value>
                    </member>
                </struct>
            </value>
        </param>
    </params>
</methodCall>

Thanks Justin, That helped. Please help with the below too.

  1. Any limitation on the number of custom fields to be created, i see few are not getting updated with values.
  2. How should i updated yes or no for type yes/no. in the below example even though the response is 200 but not seeing the Yes selected.

PFB details.
endpoint:
https://api.infusionsoft.com/crm/xmlrpc/v1
Request:

<?xml version="1.0"?>
<methodName>DataService.update</methodName>

<params>

    <param>

        <value>

            <string>KeapAK-</string>

        </value>

    </param>

    <param>

        <value>

            <string>ContactAction</string>

        </value>

    </param>

    <param>

        <value>

            <int>62</int>

        </value>

    </param>

    <param>

        <value>

            <struct>

                <member>

                    <name>_crnewleadcallrail</name>

                    <value>

                        <string>No</string>

                    </value>

                </member>

            </struct>

        </value>

    </param>

</params>

Response:

<?xml version="1.0" encoding="UTF-8"?>
<params>

    <param>

        <value>

            <i4>62</i4>

        </value>

    </param>

</params>

Thanks in advance.

You are limited to creating 100 custom fields for each Object type. So 100 custom Contact fields, 100 custom Task fields, 100 custom Order fields, etc.

For updating a Yes/No field use 1 and 0 values.

Example to set Yes:

<?xml version="1.0"?>
<methodCall>
    <methodName>DataService.update</methodName>
    <params>
        <param>
            <value>
                <string>apiKey</string>
            </value>
        </param>
        <param>
            <value>
                <string>ContactAction</string>
            </value>
        </param>
        <param>
            <value>
                <int>187</int>
            </value>
        </param>
        <param>
            <value>
                <struct>
                    <member>
                        <name>_YesNoField</name>
                        <value>
                            <string>1</string>
                        </value>
                    </member>
                </struct>
            </value>
        </param>
    </params>
</methodCall>

Hi Justin,
Thanks for the support, could you please help me with the below.
How do i get the values of the tab unders task.
I have tech tab → and sever custom fields with values, so if i want to get the tech tab values from task is there a way?
app id: https://bio997.infusionsoft.com/

thanks in advance

Please clarify a bit…

Are you trying to get the name of the tabs, the name of the fields, or the value that is stored in the fields found on that tab?

the values under the custom fields of tab(tech) under a task.
request endpoint: https://api.infusionsoft.com/crm/rest//tasks?since=022-01-25T00:17:59.039Z&until=2022-01-25T23:17:59.039Z&access_token=o1Te1aneFuCg972KbeZXsh43Gt1N

response:
{

"tasks": [

    {

        "id": 132,

        "title": "physical test",

        "description": "physical test",

        "type": "Other",

        "priority": 3,

        "completed": false,

        "contact": {

            "id": 150,

            "email": null,

            "first_name": "RICHARD UNTEN",

            "last_name": ""

        },

        "url": "https://api.infusionsoft.com/crm/rest/v1/tasks/132",

        "due_date": "2022-01-03T18:30:00.000Z",

        "creation_date": "2022-01-25T14:59:06.000Z",

        "modification_date": "2022-01-25T14:59:53.000Z",

        "completion_date": null,

        "remind_time": null,

        "user_id": 30

    }

],

"count": 1,

"next": null,

"previous": null,

"sync_token": "MjAyMi0wMS0yNVQxMDo1ODoxOC4zMTMtMDU6MDA="

}

but the i dont see the values of custom tech tab of a task. PFA task tab snapshot.

You will need to leverage the XmlRpc API’s DataService in order to work with custom task (ContactAction) fields

Hi Justin,

Another thing noticed is when tried listing the tasks i could only fetch the tasks that i created from the Web UI and not the ones i created through the REST API not able to understand what is the difference between these two.

One difference i understood was the task created through REST API has custom fields also updated through contacActions but the one created from the webui does not allow me to add tech tab details.

Please clarify and also plz give me example to fetch all tasks and its custom fields values(Tech Tab), It would be great if you can connect via some zoom/google meet to see this live and advise. Please let me know if its fine so that i can share the meeting link with you over the email.

Good evening Shaik,

We do not provide individual consultation with our engineering staff. If you are continuing to have issues, please file a ticket with our Support team, who can reach out to you directly.

https://developer.infusionsoft.com/support/tickets/create/

It was really informative. Thank you !!!

Regards,
John Bowhunting Academy
https://huntingfellow.com/bow-hunting/