You need to sign in to do that
Don't have an account?
stevenjin
Field IDs and Server Instance Split
A Salesforce Organization that I'm involved in is going to be part of a server split. Somewhere in this I have a controller that uses a hard coded field ID in order to prepopulate fields when visiting a link. Am I correct in thinking this will be affected in the server split?
Is there a way to dynamically get the ID of the field so I don't have to hard code this in?
Is there a way to dynamically get the ID of the field so I don't have to hard code this in?
Here are two common options to solve your problem.
1. Move this from a hard coded ID to a Custom Setting. If you move this to a Custom Setting, when you move your Org you can easily change the ID of the field without doing a code deploy.
2. Instead of using Hard Field ID's look at using FieldSets to accomplish your goals. This is why Field Sets where built in the first place. http://www.salesforce.com/us/developer/docs/pages/Content/pages_dynamic_vf_field_sets.htm
All Answers
Here are two common options to solve your problem.
1. Move this from a hard coded ID to a Custom Setting. If you move this to a Custom Setting, when you move your Org you can easily change the ID of the field without doing a code deploy.
2. Instead of using Hard Field ID's look at using FieldSets to accomplish your goals. This is why Field Sets where built in the first place. http://www.salesforce.com/us/developer/docs/pages/Content/pages_dynamic_vf_field_sets.htm
Hey Cory,
Thanks for the reply. I am using the field ID to prepopulate a form thorugh URL using the CF0+ID format. I think what you mean by field sets is to create a custom VF edit page in which case I can just pass the parameters in the URL? Currently I am linking to the standard edit page so I would have to create another VF page for this. Not sure of what I'll do at the moment.
Thanks again for the answer.