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
AaronKingAaronKing 

Modify the "Save and New" Buttons?

Question: we have  teams using different task record types;

 

In order to save users time, I did not want them to have to go through the select record type screen when they create a new task;  I created custom buttons that  will automatically select the appropriate task record type, and this is working fine.

 

However, when a user hits "save and new" on a task, then they get routed to the "select record type" screen.  Is there anyway I can modify the "save and new" button the same way I made my custom buttons?  I could not find anything...

thanks

-Aaron

Joe SantosJoe Santos

Ran into the same problem last fall.  I assume you're doing the RT assignment in Javascript behind the button?  Here's what I did:  Create a shell VF page with Apex controller logic behind it to do the same RT assignment you're doing in Javascript:

 

<apex:page standardController="Your_Object__c" extensions="Your_Object_ControllerExt" action="{!newYourObjectURL}">
</apex:page>
             

 

Override the New button to have it launch that page.  The newYourObjectURL method in the controller extension should return a page reference containing the RT parameter.  Also include in that URL the parameter "nooverride=1", otherwise the page will just keep refreshing itself.  Hope this helps.