Search code examples
salesforcevisualforce

Put custom links outside weblinks section


How can I put custom links outside the web links section in a salesforce page? Or is there a way I can create more than one weblinks section?

If not is there a way I can create a custom field that can call a javascript method ? (my custom links calls a js method that after validation will call a web service to do some work.) I tried creating a custom field (formula) but I wasnt able to call a js function from there, or put some script.

What I want to do is spread my custom links I have in the weblinks section into different sections on the page.


Solution

  • I have used this method to override link and button actions in the past. You could use the same method for move elements around the page too.

    Create a visualforce page and use it to override the standard page for the object you want to modify. The override page needs to use the standardcontroller for that object. You can use an extension controller for adding Apex functionality if necessary.

    Use the detail tag to render the guts. Then put in a script tag to select the anchor links you want to move around the page. It will take some inspection with your browsers debugger to find exactly what you are looking for.

    <apex:page StandardController="CustomObject__c" extensions="CustomObjectController"  >
        <apex:detail relatedList="false" inlineEdit="true" id="mydetail" />
        <script>
             // select your elements you want to move, edit or delete here
        </script>
    </apex:page>