You need to sign in to do that
Don't have an account?

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:
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?
What i've done so far is:
String endpoint = 'https://XXX.salesforce.com/services/data/v41.0/tooling'; String param = '/sobjects/CustomField/{Custom Field Id}?_HttpMethod=PATCH'; HttpRequest req2 = createHttpRequest(endpoint+param, 'POST'); req2.setBody('{"Metadata":{"summaryFilterItems":[{"field":"MyObject__c.MyField__c","operation":"greaterThan","value":"1/01/2018"}]}}'); 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'); req.setEndpoint(endpoint); req.setMethod(method); 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?