function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Raquel RiemerRaquel Riemer 

Create a button

I have a custom object Travel with two record types and layouts.
Under Travel, there are Travel Interests where would connect all the contacts interested in that particular travel. These also have two record types and layouts.
What I want is to modify the New button (or create a different one) so that when creating a new travel interest it first looks at the record type of the Travel it is attached to, to decide which travel interest record type/layout to use
RD@SFRD@SF
Hi Raquel,

It is possible, but the you would have to move the new travel interest button on to the travel object. As you want to compare the recordtype of the travel object.

Follow the following steps.
1. Create a new button on travel object, let it be a detail page button and a URL to redirect to.
2. From travel interest tab, try creating a record for the record type 1, on the new travel interest page. Get the URL from the browser and paste it in the URL of the detail button created in step 1. Now whenever the step one button is clicked the page would get redirected to the creation of the new page but the record type selectoin screen would be skipped.
3. Similarly create another button for the record type 2.
4. Keep the button labels same. But place them on different page layouts such that 
a. Record type 1 of travel page has the button which redirects to Record type 1 of travel interests.
b. Record type 2 of travel page has the button which redirects to Record type 2 of travel interests.

Hope it helps
RD