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
JashuganJashugan 

activesalesforce Custom Object Name restriction

The activesalesforce plugin severely limits the names you are allowed to give to your custom classes. You cannot have any underscores in the API name for your custom object. So a name like "Core_Product" must be renamed to "CoreProduct", otherwise activesalesforce has a fit.

This class:


class SfCoreProduct < ActiveRecord::Base

set_table_name "Core_Product__c"
set_primary_key "id"
establish_connection "salesforce"

end


produces this error:


INVALID_TYPE: sObject type 'CoreProduct_c__c' is not supported


Setting the Salesforce object to "CoreProduct", and changing the "SfCoreProduct" class to the following code works.


class SfCoreProduct < ActiveRecord::Base

set_table_name "CoreProduct"
set_primary_key "id"
establish_connection "salesforce"

end


I have developed several S-Control's in the past using Javascript and Flex, and neither of those connectors changed the salesforce custom object names specified. I have two options:

1. Remove underscores from all of custom objects and the S-Controls that use them.
2. Hack activesalesforce to use the table name specified in "set_table_name".

Neither of these seem to appealing
RupRup
see ActiveSalesforce bug "[#5515] Underscores in Custom Object Names keeps scaffolds from being generated" :
http://rubyforge.org/tracker/index.php?func=detail&aid=5515&group_id=1201&atid=4729

I'm afraid you will have to remove underscores in your salesforce class names.
JashuganJashugan
Yeah, that's what I ended up doing.
terryroeterryroe

I realize this is a very old thread.  I can't seem to find any information that is more up-to-date.  It doesn't appear that this issue has ever been addressed.  Is it still the case that underscores must be removed from custom object names?

 

TIA for any help provided.

 

TR