function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Leonardi KohLeonardi Koh 

updating CustomFieldMetadata with tooling API?

So i've been trying to update the CustomField metadata using Tooling API through Apex class, but i have no idea if this is actually possible.

What i've done so far is:
String endpoint = '';
String param = '/sobjects/CustomField/{Custom Field Id}?_HttpMethod=PATCH';

HttpRequest req2 = createHttpRequest(endpoint+param, 'POST');

String responseJSON2 = getResponse(req2);
private HttpRequest createHttpRequest(String endpoint, String method) {
        HttpRequest req = new HttpRequest();        
        // endpoint += '';
        req.setHeader('Authorization', 'Bearer ' + UserInfo.getSessionID());
        req.setHeader('Content-Type', 'application/json');
        return req;
private String getResponse(HttpRequest req) {
        try {
            Http httpreq = new Http();
            HttpResponse res = httpreq.send(req);
            String reqresponse = res.getBody();
            return reqresponse;
        catch (Exception e) {
          return 'Error:' +e.getMessage();

But i've been constantly rejected by Tooling API indicating that they could not resolve the standard field name

Does anyone have any luck with this kind of process in Apex?