+ Start a Discussion

Changing Object API Name for Force.com Labs

So last year I re-purposed the force.com labs app Sales Quotes with Line Items to be an Orders app.  This allowed my client to track 'Shipped' orders, as well as 'Projected' orders related to an Opportunity.  This also made it possible to get a more accurate, granular forecast for Sales as well as Production for this manufacturing business.  


I changed the name of the custom objects from Quotes and Quote Lines to Orders and Order Lines.  However, I did not change the API names, which are something like SFDC_255_Quote__c, and SFDC_255_QuoteLines__c because I figured if I did it would mess up the Apex code that makes the Opp Line items bit work.  Its kind of confusing when performing admin functions to have to remember that SFDC_255_Quote__c is really Orders, so I would like to change it, but I'm a little scared.  


How would I approach changing the object API names to more accurately reflect what this object is and does?  Bear in mind I am a complete force.com IDE neophyte, and I know extremely little about Apex.  




forceDotMom!!!  First, sounds like a great use of an App.  Nicely done!


Renaming after the fact is a multistep process.  If it's not critical, I'd skip it.  If it's critical, I'd do something like the following (and if anyone has better ideas, let me know).


1. Backup all of your metadata using the Ant deploy tool.

2. List all objects you want to rename.

3. Find all Apex and VF that access those objects, find where they are accessed

4. Remove the scripts and the VF from production.

5. Rename the objects via the web UI.  This should now work since there are no Apex / VF references.

6. Update all of the scripts and VF pages that you downloaded locally.

7. Redeploy those scripts and VF using the Ant deploy tool.

8. If you get a failure message you need to keep trying until you deploy without errors.


And you'll want to tweak those steps for your circumstances.  The app that you mention isn't particularly complex, so this might not take as long.  And of course the usual caveats about doing it in sandbox or a DE org first apply.


Hope that helps!!


So I would use this Ant tool and NOT the IDE?  That sounds beyond my skillz.  Maybe I should just leave it and not worry about it.  Ill check into the Ant thing though.



This won't solve your current issue but at some point down the road you may want to look at the native Quotes functionality that was released with the Spring 10 release. http://sites.force.com/features/ideaView?c=09a30000000DCUV&id=0873000000078I0AAI


To use this you would need to migrate over your existing Quote and Line item Data to the new Quote__C and QuoteLineItem__c objects.  I'm not recommending that you necessarily do this, I just wanted to make you aware of the new functionality;)