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
cmarkcmark 

back button and scontrols...

Hello.  I have an scontrol which is launched by pressing a button on a contact detail page.  The scontrol creates a new record, attaches it to the contact, and directs the user to the detail page of the new record.  Recently, a user pressed the scontrol button, then wanted to go back to the contact - so he/she pressed the browser's Back button.  This launched the scontrol again and created another new record.  Is there any way to prevent this?

My only thought is to have the scontrol launch in a new browser - so there would be no page for that browser to go back to.  But I would like to keep the current settings if possible.

Thanks
Chris
Greg HGreg H
A really simple way around this is to create a custom link/button but not add it to the page layout.  Your link/button should reference your sControl.  Then instead of calling the sControl directly from your current button (the one you mention in your post) you should call the link you just created.  This will still display your sControl but when your user clicks the "Back" button on the browser they will truly go back to the original page not the sControl.
-greg
iSfdciSfdc
Hi,
Thanks for the knowledge sharing. We even have the same requirement ,but we need to override the New button.In that case we cannot go for a Custom Link.Is there any other Solution for this
 
Thanks
Gani
sfdcfoxsfdcfox
Code:
window.top.location.replace('{$URLFOR($Action.Opportunity.New,null,[params],true)}')

 You can use the replace command to overwrite the current history location (the S-Control). Pressing back will cause the user to visit the page before the S-control instead of the S-Control itself.
iSfdciSfdc

Thank you,Its working

Gani