You need to sign in to do that
Don't have an account?
Error trying first example in Apex reference manual
I'm sure it's me, but...
On pages 27-29 of the Apex language reference manual, there is an example that creates a custom object (Book_c and a custom field within the object Price_c). Then, a sample for loop within an apex class is demonstrated with the code below:
public class MyHelloWorld {
public static void applyDiscount(Book_c[] books) {
for (Book_c b :books)
{
b.Price_c *= 0.9;
}
}
}
However, when I try to build this code , I get the following error:
Error:Compile Error: Invalid type: Book_c at line 3 column 6
Like I said, I'm sure it's me but...why is this not working?
Thanks for any assistance
Got the answer in another forum:
It is Book__c (two underscores)