Salesforce Class Sync Issue

apex
salesforce

#1

When I create a Class in Cloud9 and trying to sync to Salesforce I am getting this error:
STATUS: ENOENT: NO SUCH FILE OR DIRECTORY, OPEN
’/HOME/UNBUNTU/WORKSPACE/C9/SYNCHRC
META.XML’

Steps

  1. Right Click on Classes Folder
  2. Click on New File
  3. Enter Class Name with extension .cls (Example: HelloWorld.cls)
  4. Right basic class Body
  5. Click on File > Save

Cloud9 tries to sync up and I see the error above.

Note: If I create the Class in Salesforce there is absolutely no issue. but I would like to create the Class in Cloud9 and sync to salesforce.

I used the same approach with Trigger and they work well, no issue whatsoever.

Can you pleas tell me what I am doing wrong?

Thanks in advance for your help !


#2

Ditto. Found a work around though. Go to Cloud9 > Preferences (Ctrl+,) under User Settings go to Tree & Navigate.
There you’ll find ‘Hidden File Pattern:’. If you remove *-meta.xml from the list, you’ll see the meta data for all your Classes, etc. Now you can duplicate by right-clicking (in Workspace’s file tree) an active one and rename it after your class that won’t upload/sync

e.g
You have - myClass.cls
So make - myClass.cls-meta.xml
Containing something like:

<?xml version="1.0" encoding="UTF-8"?>
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>38.0</apiVersion>
    <status>Active</status>
</ApexClass>

Save both files and it should finally sync up.

Hope it helps