• Arpi Jakab 8
  • 15 Points
  • Member since 2016

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
  • 1
Hi, I have a custom object that has a series of default fields. When I create a new SObject and insert it, all the default field values are assigned.

1. Create a custom Object with a custom field of type 'checkbox' that is set to 'checked' by default
2. Create an instance of this object using [Custom Object Name].newSObject(null, false); 
3. Insert the newly created object
4. [select Checkbox__c from CustomObject]
5. Notice that checkbox is set to 'true'.

This is not limited to checkboxes, all field types have this problem, picklists, text, etc...

Hi All,


I want to get all fieldnames of a object in apex. How can I do this?


For example for User object I want to get all its field names like AboutMe, AccountId , Email etc.


Any help on this really appreciated.




  • January 18, 2012
  • Like
  • 0