I'm relatively new to Salesforce, so I my be missing something basic here:
There is an existing Enterprise site. It has a number of custom fields (i.e. Account.MyCustomField__c), pages and of course lots of customer data. As far as I can tell it was all setup from within the Salesforce instance itself (no custom Apex code or special packages)
I want to add an Apex class to this - a tiny Schedulable class with a few lines of code to select a开发者_C百科nd update one of those MyCustomField_c fields on a few records each day. To do this I signed up and created a developer site and manually recreated the MyCustomField_c (same name, API name, label, type, etc) and then created the class and it's test methods.
Now here is my concern:
When I go to create a package so that I can copy this class to the Enterprise site the custom field shows up as a dependency that will be automatically included in the package. What happens if I install this package - will the duplicate field be added/overwrite the existing one, or cause an error? Ultimately I want my apex class to use the field already in the Enterprise site of course.
Alternatively, is there some way to export the custom fields/setup from an enterprise site into a developer site, so that the resulting packages from the developer site will already take into account dependencies that are present in the enterprise version?
Are you moving the code as a packaged app (with a namespace) or via change sets? Generally we do deployments using Eclipse — we don't package things up so don't use namespaces.
The simple version is: if you're not using a namespace and a packaged app then your code should use the field that's there. If you are using namespaces, your field will automatically be created in the target org with a prefix, as such it will be a different field to the one that's there already.
精彩评论