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
rachvillrachvill 

Re-using scontrol for different custom links

Hi,

I would like to develop an scontrol that will behave differently depending on what custom link is clicked.
To illustrate, I have two custom link - "Update SObject", "Delete SObject". If Update SObject is clicked, my scontrol will do an update. If Delete SObject is clicked, I would want the same scontrol to do a deletion instead.

I tried creating a custom link URL with my additional parameter (mode=Insert) and calling the scontrol from there, but it does not work the way I wanted it to work. When I clicked on the link, the whole saleforce window (inclunding headers and tabs) is displayed - so it displays the scontrol within salesforce within salesforce.

Does anybody have idea on how I can go about this? Any help will be very much appreciated.

Thanks.

Rachel
michaelforcemichaelforce

Rachel,

It seems like you do not wish to create two s-controls (one for updating, and one for deleting) because it is a shame to have to maintain two seperate s-controls that have so much code in common.

If that is correct, then you can make use of 'snippets' in winter '07.  Use a snippet to store and maintain the code common to both, and then have two seperate s-controls that have minimal lines that call the snippet to do updates or deletes.  Then have your custom links call the proper of these two.

Hope this helps.