Prepopulate fields in Salesforce.com

I have a doubt, i've been working with salesforce for a while and now i have a requirement from a customer.

They need that some custom fields be populated with a value of parent object, making some research on stackoverflow, i found this post, but this isn't working for me because my project is a manage package and when this is installed on a another salesforce instance the id of custom field change.

if someone could help me, I will be grateful.

Thanks!.

Upvotes: 2

Views: 1343

Answers (1)

Matt Lacey
Matt Lacey

Reputation: 8255

I can't see any way of doing the same as that post without using the IDs, I was thinking you could route via a VF page and build up the URL in the controller but it doesn't seem as though you can get the IDs of fields, just their type etc..

I think the best you could do in this instance is to override the default new recordpage with a visualforce page. In the constructor of your controller you could then loop through the page parameters and pre-fill the corresponding fields on the new record before it's displayed on screen. Using fieldsets or just an <apex:Detail> component would keep the level of effort down and also maximise the flexibility of the page for the end users.

Upvotes: 1

Related Questions