Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8897583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:22:53+00:00 2026-06-15T00:22:53+00:00

I am new in apex programming. I am using site.com. I am creating New

  • 0

I am new in apex programming. I am using site.com.
I am creating New apex class using this code —

@isTest 
private class HelloWorldTestClass {
    static testMethod void validateHelloWorld() {
       Book__c b = new Book__c(Name='Behind the Cloud', Price__c=100);
       System.debug('Price before inserting new book: ' + b.Price__c);

       // Insert book 

       insert b;

       // Retrieve the new book 

       b = [SELECT Price__c FROM Book__c WHERE Id =:b.Id];
       System.debug('Price after trigger fired: ' + b.Price__c);

       // Test that the trigger correctly updated the price 

       System.assertEquals(90, b.Price__c);
    }
}

but it gives me this error -Error: Compile Error: sObject type ‘Book_c’ is not supported. If you are attempting to use a custom object, be sure to append the ‘_c’ after the entity name. Please reference your WSDL or the describe call for the appropriate names. at line 13 column 12.

help me out..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T00:22:54+00:00Added an answer on June 15, 2026 at 12:22 am

    Have you actually created such object in your Salesforce instance? There are some standard objects (like User) and you most likely also have the objects related to the CRM product (like Account, Contact, Opportunity) but Book__c will be a custom object created by you or another System Administrator in your organization.

    Check Setup (upper right corner in web interface) -> Create -> Objects. There’s a youtube tutorial or you can always click “Help for this page” link.

    To expose this object on the Site (which means anybody in the world will be able to view and insert Books) you’ll have to follow few more steps. But as it’s a test class that fails to compile I think you haven’t reached this problem yet. More info about permissions: http://login.salesforce.com/help/doc/en/siteforce_data_access_perms.htm

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We need to add an attachment for new contact. We are using APEX class
I need to convert this java code in force.com apex. i tried to use
I'm pretty new to APEX ( well, just started using it ~an hour ago),
New programmer here, I am trying to understand and break down this code below
This is an APEX code related question and is specific to a VisualForce controller
When i'm calling this code in the link of a chart in apex javascript:window.open('http://google.pt','mywindow','width=400,height=200',
I have a custom portal integrated with a custom site, using Apex/Visualforce. I want
New to javascript/jquery and having a hard time with using this or $(this) to
I'm currently learning apex (using the Force.com IDE), and I'm running into some trouble
I am new to salesforce application. I am using Apex. My requirement is to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.