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

New to salesforce, have a question about creating a object?

Hi, I was wondering if anyone can help me out with something. I was wondering if You can create a object like "Contacts" and add other fields like phone number, age, address street, zip all from eclipse ide. 


Then I was wondering if I can get the max age, min age, average age and number of contacts.



David VPDavid VP

Why don't you just create them in the setup area of your salesforce org ?

A few mouseclicks is all it takes to setup objects, fields etc...


As far as your max age, nr of contacts etc... are concencerned : You can create a report for that in salesforce (again, just a couple of mouseclicks to put it together).



(by the way : 'Contact' is a standard object, you shouldn't need to create it)


I created the object in setup was just wondering if you do the same thing with apex code. For the min, max average age, I want to create a visualforce contact result page so I learn more about apex and visualforce. I am just trying to figure out how I would call that object and display the results in my visualforce page.. 

Message Edited by intern2424 on 10-31-2009 04:15 PM
You can't currently create new fields on an object with Apex. I have no idea if this is on the roadmap.




I dont think creating object using Apex is in the roadmap for now.

Objects are basically XML files as far as salesforce is concerned.

You can create Custom objects  from Eclipse with IDE (plugin) installed.

Go to prospective, create/import your salesforce org, right click then

New -> Custom Object

This is not really doing it using Apex. This process uses Meta Data API's.


You can get min, max ... using SOQL Queries from Visualforce controllers and then show them on the page.

Salesforce provides a Standard Contact object that you can use. 

You can add fields to it from your salesforce org by,

Setup> App Setup > Customize > Contacts > Fields > Contact Custom Fields & Relationships


Please try to go through docs that explain functionality fully. You might be creating something that is provided out of the box. ...


Plenty of help is available online ....