Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I was looking at ways to prepopulating standard layout pages the link below was helpful in getting it to work. How do I prepopulate fields on a Standard layout?

But i need to allow users to select record type and then prepopulate. Any body done with recordtypes?

share|improve this question
up vote 3 down vote accepted

Assuming that you are using a custom button to navigate to the page, all you need to do is to copy the link that you get when you click the "New" button for that object. And use it in your custom button and keep rest of your parameters(which you use to populate the standard page) the same.

share|improve this answer

The $Action global variable allows you to do this without hard coding the URL. Most actions and their SFDC url can be accessed through this global variable.

Typical usage is in conjunction with the URLFOR function.

For instance, in your case, to create a new record:


If the object in question has record types enabled, you will automatically be redirected to the record type page.

This is a more durable solution than hard coded URLs since you can create your custom button today on an object that doesn't have record types, and tomorrow when you enable record types, it should automatically pick up the change continue to work without modifying your custom button. It also automatically picks up retURL values from where you put the button.

There are some instances where you have to resort to hard coded URLs, but they are few and far between. I'd always recommend looking into this option first.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.