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
rtriggrtrigg 

CustomField from Tooling api via REST generates error

Hi wizards,

 

I'm trying to use the tooling API via REST to build custom fields in an existing custom object.  No matter how I name the object, I get picklist errors - here's an example:

 

<?xml version="1.0" encoding="UTF-8"?><Errors><Error><errorCode>INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST</errorCode><fields>TableEnumOrId</fields><message>Entity Enumeration Or ID: bad value for restricted picklist field: a0m</message></Error></Errors>

 

In that case I passed the key prefix of the object (a0m) as the value of the TableEnumOrId field in the JSON, but I get the same error if I pass the object name, "DonorScape" or "DonorScape__c".  Here's my curl call:

 

curl -b /tmp/cookies.txt -c /tmp/cookies.txt https://na15.salesforce.com/services/data/v28.0/tooling/sobjects/CustomField/ -H 'Content-Type: application/json' -d '{"DeveloperName" : "Test__c" , "FullName" : "DonorScape__c.Test__c" , "TableEnumOrId" : "a0m"}' -H 'Authorization: OAuth <token>' -H 'Accept:application/xml' -X POST

 

Any ideas?  Thanks much!

 

   - Randy