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
maybemedicmaybemedic 

Unable to refresh Apex Classes from server

Hello All,
              I am fairly new to apex development. I created a class in our orgs sandbox and I tried the option of refreshing from server in the force.com IDE. The most recent class that I put in SF is not being refreshed onto eclipse. But if I create a class in eclipse and try saving it onto the server, thats working. But the other way is not. I am using IDE 14.01 and API Ver 14. Also, I tried executing the apex code in the "System Log", I get an exception

 "ERROR - Compile error: Global type must be contained inside of a global class ",

but I am able to save the code in apex editor so I believe that means it compiled successfully. I am just wondering if the exception could have been the problem. I tried searching the board for any clarification on this problem but couldn't find one that answers me. I'd appreciate any help in this regard. Thanks all.



Message Edited by maybemedic on 12-30-2008 11:36 AM
JeremyKraybillJeremyKraybill
Please post your code that is throwing this error.

Jeremy Kraybill
Austin, TX
maybemedicmaybemedic
Jeremey,
                Thanks for your reply. The following is the code,

Code:
global class ContractObject {
    
    public String contractID;
    public String status;
       
    public ContractObject() {}
    

    static testMethod void testContractID() {
        ContractObject contractObject = new ContractObject ();
        System.debug('' + contractObject.contractID);    
    }           
}

 

JeremyKraybillJeremyKraybill
Nothing is obviously wrong with that code. When you say
Also, I tried executing the apex code in the "System Log", I get an exception
What exactly do you mean? Are you hitting the "Run Test" button or something else?

Also, are you doing this in a Developer Edition environment? I know there are some restrictions on global classes that only apply to Developer Edition.

Jeremy Kraybill
Austin, TX
maybemedicmaybemedic
Jeremy,
              I just pasted the code in "System Log" and select "Apex Code" from the picklist and execute it. I tried saving the code in apex editor saved it and ran test. No problem. Also, I use a full Sandbox created for our development effort. Thanks.
JeremyKraybillJeremyKraybill
Yeah, that probably isn't working because the system log is not a global class. In general that's not a good way to test, I would recommend just doing what you are trying to do (via VisualForce page / etc.) and take it from there.

Jeremy Kraybill
Austin, TX
maybemedicmaybemedic
Thanks for your help Jeremy, that was good to know.