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
TaoTao 

'caller is undefined' Error in sforce.console.openPrimaryTab

When I use sforce.console.openPrimaryTab in the custom button(list button), I got a error: 'caller is undefined'.

My javascript code:

    ---------------------------------------------------------------------------------------------
    {!REQUIRESCRIPT("/support/console/25.0/integration.js")}

    sforce.console.openPrimaryTab(
        null,
        'www.google.com',
        true,
        'My tab name'
    );
    ---------------------------------------------------------------------------------------------



But when I use it in the visual force page, the error does not appear:

    ---------------------------------------------------------------------------------------------
    <apex:includeScript value="/support/console/25.0/integration.js"/>

    <script type="text/javascript">
    function toExistContact(url,tabName){
        sforce.console.openPrimaryTab(
            null,
            url,
            true,
            tabName
        );
    }
    </script>
    ---------------------------------------------------------------------------------------------

Anyone tell my why?.....