• jchanowitz
  • NEWBIE
  • 25 Points
  • Member since 2007

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 18
    Replies

Hi,

 

I'm trying to access a SFDC database from Rails, that has a custom object Employee__c, which in turn has a self referential foreign key Supervisor__r, pointing back to Employee__c.  In Rails, I have a model Employee, which has a set_table_name of 'Employee__c'.  Does anyone know how I can get the supervisor's name on a query to the employee.  It doesn't seem as if Rails allows a model to associate to itself.  Also, if I try just to pass the soql directly by using Employee.find_by_sql(), I can't figure out how to label the Supervisor__r foreign key in my query (which is being changed to supervisor_id__c when returned by asf).  For example:

 

Employee.find_by_sql("select e.id, e.name, e.Supervisor__r.name from Employee__c") returns

 

NoMethodError: You have a nil object when you didn't expect it!

The error occurred while evaluating nil.name

from C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-activesalesforce-adapter-2.0.0/lib/active_record/connection_adapters/activesalesforce_adapter.rb:353:in `add_rows'

from C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-activesalesforce-adapter-2.0.0/lib/active_record/connection_adapters/activesalesforce_adapter.rb:347:in `each'from

C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-activesalesforce-adapter-2.0.0/lib/active_record/connection_adapters/activesalesforce_adapter.rb:347:in `add_rows'

from C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-activesalesforce-adapter-2.0.0/lib/active_record/connection_adapters/activesalesforce_adapter.rb:344:in `each'from

C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-activesalesforce-adapter-2.0.0/lib/active_record/connection_adapters/activesalesforce_adapter.rb:344:in `add_rows'

from C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-activesalesforce-adapter-2.0.0/lib/active_record/connection_adapters/activesalesforce_adapter.rb:327:in `select_all'from

C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.3/lib/active_record/base.rb:661:in `find_by_sql'

from (irb):10

 

Has anybody done this?

 

Thanks in advance.

I'm all of a sudden unable to use a Sandbox project in Eclipse.  If I try to "Refresh from Server" for any asset under src/unpackaged  I get back a ServiceException stating the package was deleted in my production organization and is no longer accessible from the sandbox (UNKNOWN_EXCEPTION).   

 

An app I have still works when pointing to the sandbox, the schema explorer for the project still works, and I'm able to see my classes, triggers, etc. in the correct sandbox from the salesforce UI.  Developer instance Eclipse projects still work, and any new sandbox projects I create throw the same errors.

 

I haven't changed anything between it working and not working, (other than a pretty long SF maintanance outage Friday nite??).

 

Anybody else seeing this behavior with sandboxes, or am I personally doing something stupid here.  

 

Thanks.

I have hierarchical type data in SalesForce that I'm trying to bring over to a client via  an Apex web service.  As an example I have a directory tree structure consisting of "folders" and "files", where folders can contain files and other folders.  The classes I'm trying to build are
 
Code:
global class Folder {
    webservice ID id;
    webservice String title;
    webservice File[] files;
    webservice Folder[] subFolders;
}

global class File {
    webservice ID id;
    webservice String title;
}

My objective is to return the top level folder, which would have within it the entire tree structure of what I'm trying to render in my client.  When I try to compile, I get:
 
Unable to perform compile/save/delete: SoapFaultException: UNKNOWN_EXCEPTION: An unexpected error occured. Please include this ErrorId if you contact support: 76227213-49
It seems the subFolders member is causing the error.  If I remove either the array or the webservice keyword, things compile just fine.  Is there any way to do this?
 
Thanks
I'm trying to use the Value Object design pattern to call an Apex Code web service method to save a non-trivial object graph into the database.  My client is Flex / Flex Toolkit.  I create an SObject in the client, using the name of the custom class I've created in my Apex class, something like: 
 
.  I then pass that object as a parameter to

I’m trying to invoke Apex code exposed as a web service from Flex using the Flex Toolkit, and am having cross domain security issues again.  It works fine when I run it as a local file.  When running from a domain, I get back "Security error accessing url."

 

The policy file that the Toolkit loads is at:

 

http://na3-api.salesforce.com/services/Soap/u/cross-domain.xml

 

But the endpoint that I’m calling is at:

 

http://na3-api.salesforce.com/services/Soap/class/MyClass

 

The Flash Player Security White Paper says “The scope of the permissions defined in a policy file includes all resources within the directory and within nested subdirectories.”

 

So it appears that the above policy file only supports API calls, and not Apex Code calls.  Is there, or could there be, a policy file to support both?

Hi,
 
I'm trying to use the flex toolkit.  I can run the salesforce.mxml app with no problems locally, but receive security sandbox errors when running from a server.  I can see the apex login call is finding a cross-domain.xml file, but i still receive the violation.
 
The domain the toolkit requests data from is: .../services/Soap/u/9.0
 
but the file is at  .../services/Soap/u/cross-domain.xml.
 
Does anyone know if it's location is an issue, or is there something else I'm doing wrong?
 
Thanks.  It sure seems like a great tool if I can deploy it.
 
Jay

Hi,

 

I'm trying to access a SFDC database from Rails, that has a custom object Employee__c, which in turn has a self referential foreign key Supervisor__r, pointing back to Employee__c.  In Rails, I have a model Employee, which has a set_table_name of 'Employee__c'.  Does anyone know how I can get the supervisor's name on a query to the employee.  It doesn't seem as if Rails allows a model to associate to itself.  Also, if I try just to pass the soql directly by using Employee.find_by_sql(), I can't figure out how to label the Supervisor__r foreign key in my query (which is being changed to supervisor_id__c when returned by asf).  For example:

 

Employee.find_by_sql("select e.id, e.name, e.Supervisor__r.name from Employee__c") returns

 

NoMethodError: You have a nil object when you didn't expect it!

The error occurred while evaluating nil.name

from C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-activesalesforce-adapter-2.0.0/lib/active_record/connection_adapters/activesalesforce_adapter.rb:353:in `add_rows'

from C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-activesalesforce-adapter-2.0.0/lib/active_record/connection_adapters/activesalesforce_adapter.rb:347:in `each'from

C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-activesalesforce-adapter-2.0.0/lib/active_record/connection_adapters/activesalesforce_adapter.rb:347:in `add_rows'

from C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-activesalesforce-adapter-2.0.0/lib/active_record/connection_adapters/activesalesforce_adapter.rb:344:in `each'from

C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-activesalesforce-adapter-2.0.0/lib/active_record/connection_adapters/activesalesforce_adapter.rb:344:in `add_rows'

from C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-activesalesforce-adapter-2.0.0/lib/active_record/connection_adapters/activesalesforce_adapter.rb:327:in `select_all'from

C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.3/lib/active_record/base.rb:661:in `find_by_sql'

from (irb):10

 

Has anybody done this?

 

Thanks in advance.

I'm all of a sudden unable to use a Sandbox project in Eclipse.  If I try to "Refresh from Server" for any asset under src/unpackaged  I get back a ServiceException stating the package was deleted in my production organization and is no longer accessible from the sandbox (UNKNOWN_EXCEPTION).   

 

An app I have still works when pointing to the sandbox, the schema explorer for the project still works, and I'm able to see my classes, triggers, etc. in the correct sandbox from the salesforce UI.  Developer instance Eclipse projects still work, and any new sandbox projects I create throw the same errors.

 

I haven't changed anything between it working and not working, (other than a pretty long SF maintanance outage Friday nite??).

 

Anybody else seeing this behavior with sandboxes, or am I personally doing something stupid here.  

 

Thanks.

I'm trying to use the Value Object design pattern to call an Apex Code web service method to save a non-trivial object graph into the database.  My client is Flex / Flex Toolkit.  I create an SObject in the client, using the name of the custom class I've created in my Apex class, something like: 
 
.  I then pass that object as a parameter to

I’m trying to invoke Apex code exposed as a web service from Flex using the Flex Toolkit, and am having cross domain security issues again.  It works fine when I run it as a local file.  When running from a domain, I get back "Security error accessing url."

 

The policy file that the Toolkit loads is at:

 

http://na3-api.salesforce.com/services/Soap/u/cross-domain.xml

 

But the endpoint that I’m calling is at:

 

http://na3-api.salesforce.com/services/Soap/class/MyClass

 

The Flash Player Security White Paper says “The scope of the permissions defined in a policy file includes all resources within the directory and within nested subdirectories.”

 

So it appears that the above policy file only supports API calls, and not Apex Code calls.  Is there, or could there be, a policy file to support both?

Hi All,
    I have created a new class (apex code) in salesforce with one webservice method in it. This method takes two arguments and creates new contact in sf.
   I want to call this method from java client. Is it possible?
   Please help to explain me asap.
 
Thanks,
Jegdish
  • September 13, 2007
  • Like
  • 0
I know this is supposed to be possible but I can't find any docs - I saw it at the last dev conf.
 
I have a webService exposed via Apex and I need to access that data from Flex Builder 2 but I can't seem to get it working.
 
If anyone has done this or knows where the docs are please get back to me.
 
thanks
-c
Hi,
 
I'm trying to use the flex toolkit.  I can run the salesforce.mxml app with no problems locally, but receive security sandbox errors when running from a server.  I can see the apex login call is finding a cross-domain.xml file, but i still receive the violation.
 
The domain the toolkit requests data from is: .../services/Soap/u/9.0
 
but the file is at  .../services/Soap/u/cross-domain.xml.
 
Does anyone know if it's location is an issue, or is there something else I'm doing wrong?
 
Thanks.  It sure seems like a great tool if I can deploy it.
 
Jay