+ Start a Discussion

how to auto populate the fields when creating a new record in standard object



Help need on how to populate the fields from the owner record when we click on "New" button in a standard objects.I heard that we can do by over riding the "New" button if that is the only way then  how to do that. Can any one help me out.


I don't have any sample code on hand, but basically here's how you can find it.

- Start from an object that's used as a lookup field on your object - ie if you want to Override the new button on Opportunities you could start from the Account. Let's  say we have a custom Lookup to Case on Opportunities and use that.

- Click the new button to create a new record (in this example Opportunity)

- Look at the querystring and find the two parameters that reference the source object (in this example the Case)

- These parameters include an embedded ID String, this belongs to the field that you are passing a value to.

- Go through setup to the field settings for the fields you want to feed values into. Lift their IDs from the URLs for these pages.

- create a new custom button with a URL value and in it mimc the syntax of the querystring parameters of your new record for each of these fields and use formula merge fields as you normally would to supply the values.