0

I have the following as my request for creating a new VF page via Tooling API:

{"Name" : "TestPage", "MasterLabel" : "TestPage", "Markup" : "< apex:page standardController='Car__c'>< /apex:page>"}

But the response is an error:

[{"message":"Object type not accessible. Please check permissions and make sure the object is not in development mode: sObject type 'Car__c' is not supported.: Markup","errorCode":"FIELD_INTEGRITY_EXCEPTION","fields":["Markup"]}]

Yes the custom object Car__c is deployed. Yes I am a system admin. No I don't know what's going on. Any help is appreciated.

  • Have you successfully saved this page through other means? – Adrian Larson May 7 '15 at 12:25
  • Yes it saves when I do it through the UI editor. Also tested with standard objects such as Account. No luck. – Mossi May 7 '15 at 21:41
1

A bit old now, but adding here in case anyone comes across the same problem.

Long story short, this process is supported using the standard REST API, rather than the Tooling API. The Tooling API docs actually says:

To create a Visualforce page, use the Force.com REST API or the Metadata API.

Found here: https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/tooling_api_objects_apexpagemember.htm

So if you just drop the /tooling/ aspect from your endpoint, it should work fine.

Eg. /services/data/v39.0/sobjects/ApexPage/

And post:

{
    "name": "MyPage",
    "masterLabel": "MyPage",
    "markup": "<apex:page standardController=\"Account\"><\/apex:page>",
}

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.