• Vikas Pandey 12
  • 0 Points
  • Member since 2015

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
  • 1

Getting started with force.com and ran into a roadblock right away.  I defined a custom object, and then used it in an Apex class definition.  However when I used the object name in the class definition (page 29 of developer guide) (with the _c), I get aninvalid type compile error. 


Went back to basics from the developers guide to replicate their simple example.  Followed instructions to define a "Book" object as in the guide, and then copied the code:


public class MyHelloWorld {


    public static void applyDiscount(Book__c[] books) {    

        for (Book__c b : books)  {    

           b.Price__c *= 0.9;    





I get similar "Error: Compile Error: Invalid type: Book__c at line 4 column 10".  Is there some setting I need to make to make the custom object visible to Apex?  I've searched everywhere and can't find any reference to it.


Can anyone point me in the right direction to get moving?