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
SFRichSFRich 

Create Object using Eclipse

How can you add custom fields to a custom object using Eclipse?

 

I'm trying to create a new object and cut/paste some custom field definitions from another object into it.  In Eclipse I created a new Custom object and got the stub XML file.  I am pasting the <fields> section XML code into it and using the Force 'Save to Server'.  I keep getting a 'do you want to refresh from server' message and when I say yes, I get the empty stub XML file back.  I have tried it with just one field and it still is not working.  Could it be a profile setting? 

Best Answer chosen by Admin (Salesforce Developers) 
SFRichSFRich
Thanks, I got it to work.  I have to hit the Save button, then Force > Save to Server.  Then I need to check the errors in the hidden tab at the bottom of the IDE.  It turns out there was an error with a master child relationship field I cut and pasted.  The name has to be unique so I can't just cut and paste it.  I left it out of the XML and added it through the web. 

All Answers

JonPJonP

Try refreshing your entire project--right-click on the "src" folder then choose Force.com > Refresh from Server.  Then go back and make your changes to the object file and save it.

 

The IDE tries to prevent you from making conflicting edits to a component that has been edited on the server since you last downloaded it.  Sometimes it gets overzealous, but refreshing the whole project usually gets things back in sync.

 

Also, what version of the IDE are you using?

 

Jon

salesforce.com Product Manager

SFRichSFRich
Thanks, I got it to work.  I have to hit the Save button, then Force > Save to Server.  Then I need to check the errors in the hidden tab at the bottom of the IDE.  It turns out there was an error with a master child relationship field I cut and pasted.  The name has to be unique so I can't just cut and paste it.  I left it out of the XML and added it through the web. 
This was selected as the best answer