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
Naveen JainNaveen Jain 

Apex Compile Error - Invalid Class Restrequest

I have this very simple class that I am trying to create and am getting compilation error.

 

Can someone help resolve this?

 

Error: Compile Error: Invalid class: restrequest at line 6 column 32 

 

/* test*/
@RestResource(urlMapping='/Account/*')
global with sharing class AccountRestSvc {

  @HttpGet
  global static Account doGet (RestRequest req, RestResponse res) {
    return [select id, name from account limit 1];   
  }

}

dkadordkador

Your org is apparently not enabled for the pilot.  Are you using a DE org?  If so, post your org ID here and I'll have somebody enable you.

Naveen JainNaveen Jain

Can it be turned on for Sandbox?

 

Org id of Sandbox is - 00DT0000000KQx5

dkadordkador

No, currently the pilot is limited to developer edition organizations.  If you don't have one you can sign up for free.  Please use that to try the pilot of Apex REST.  Thanks.

Naveen JainNaveen Jain

Thanks. Working with Support to turn this on.

dkadordkador

If you're in a DE org, just post your org ID here and I can get you enabled.  No need to mess with support.