10

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)

  • 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 '13 at 23:18
  • 1
    @RyanGuest Thanks for reaching out! I went ahead and logged a case (#09822682). – Greg Grinberg Oct 23 '13 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.. – Guy Clairbois Sep 30 '14 at 19:12
  • @guy No, as far as I know the tooling API still doesn't support this. – Greg Grinberg Sep 30 '14 at 20:17
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'
]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.