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
mail2ghani1.3921762673905103E12mail2ghani1.3921762673905103E12 

Compile Error: Return type of global method must also be global: Account

Hai all
 i get the error  Compile Error: Return type of global method must also be global: Account at line 5 column 23

Resource(urlMapping='/Account/*')
global with sharing class MyRestResource
{
  @HttpGet
global static Account doGet ()
   {
    RestRequest req = RestContext.request;
    RestResponse res = RestContext.response;
    String accountId = req.requestURI.substring(req.requestURI.lastIndexOf('/')+1);
    Account result = [SELECT Id, Name, Phone, Website FROM Account WHERE Id = :accountId];
     return result;
    }
}
Sonam_SFDCSonam_SFDC
Hi,

Do you by any chance have a custom object in your org named Account ?
while investigating for your case I came acros these posts which talks about a similar issue:
http://salesforce.stackexchange.com/questions/24278/error-while-trying-webservice
https://developer.salesforce.com/forums?id=906F0000000915PIAQ

pls go thru and update if this helps!