11

I can successfully make a patch request to the tooling api to update a custom fields api name. However, if I include any of the field properties in the CustomFieldMetadata object I get an internal salesforce error.

successful request:

PATCH: /services/data/v29.0/tooling/sobjects/CustomFieldDefinition/{ID}
{
 "DeveloperName" : "NewName"
}

failed request:

PATCH: /services/data/v29.0/tooling/sobjects/CustomFieldDefinition/{ID}
{
  "DeveloperName" : "NewName",
  "Metadata" : {"length": 100}
}

gack ids:

118968544-21444 (-1657627855)

1623052628-129393 (-1657627855)

4
  • Have you filed a case with salesforce support yet? I'd like to link this issue to the support case if you have one.
    – Ryan Guest
    Oct 22, 2013 at 23:18
  • 1
    @RyanGuest Thanks for reaching out! I went ahead and logged a case (#09822682). Oct 23, 2013 at 16:00
  • hey there, any updates on your cases? I'm trying to build a tool to fetch/update field descriptions which needs this functionality.. Sep 30, 2014 at 19:12
  • @guy No, as far as I know the tooling API still doesn't support this. Sep 30, 2014 at 20:17

2 Answers 2

5

This is a known issue with the tooling api with no current ETA for the fix. The bug number is W-1904760.

For other people who want to programmatically work with their custom field metadata I would recommend Andrew Fawcett's excellent metadata api wrapper.

3

Do not have enough reputation points to post this as a comment, so having to post as an "answer".

Just wanted to let you know that you are not alone. It looks like a common problem on SFDC side.

Here is what I get when try to update text field length using SOAP flavour of Tooling API.

    val f = new CustomField
    f.setId("00Ni0000009THQL")
    val md = new CustomFieldMetadata
    md.setLength(12)
    f.setMetadata(md)
    session.update(Array(f))

Result

[ApiFault  exceptionCode='UNKNOWN_EXCEPTION'
exceptionMessage='An unexpected error occurred. Please include this ErrorId if you contact support: 497298247-26206 (803645494)'
upgradeURL='null'
upgradeMessage='null'
]

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .