Take the 2-minute tour ×
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.

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
add comment

2 Answers 2

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
add comment

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:

{!URLFOR($Action.MyObject__c.New)}

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
add comment

Your Answer

 
discard

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.