0

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?

2 Answers 2

3

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.

2

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .