You need to sign in to do that
Don't have an account?
Rocky.4Q
Pre-Populating Fields
I'm doing a peer review this week I'm having issues with a suggestion for how to avoid hard-coding when prepopulating. The HTML field id's change when refreshing or from dev to ci > qa > prod. Should we avoid pre-populating all together, or is there a way to do this taht ensures we won't have to update hard-coded values ever>
Are you talking about pre-populating fields on the standard salesforce UI or custom visualforce pages?
Their trying to populate a Custom Object edit page, and a Stadn Object edit page. One is using a custom button to pass via URL and one is using an Apex class to put the url params on and then redirect. Both, however require the html field ID in order to know which to populate.
In the case of a VF page, if you're using a controller extension or custom controller, you can check for parameters (that you define) passed in the URL. This type of pre-populating is fully supported.
Standard objects are a different story, and this is one area of salesforce that everyone bends the rules (even salesforce professional services) by passing values in the URL using the field IDs. The field IDs are an implementation detail and are subject to change without notice, which is what makes this a gray area. However, salesforce customers have been doing this for as long as I can remember, and I've yet to experience an upgrade that caused previously created links to break.