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
BeatofHeartBeatofHeart 

Service cloud browser issue - VF page

Hi,

 

MY VF page not ( New contact button ) not working in IE and Firefox. it works good in Chrome. please suggest if any thoughts.

 

when i click new contact button  it has to open in new primary tab.

 

Many Thanks

Beat.

<apex:page Controller="ContactSearch" sidebar="false" id="page">
<apex:pageMessages />
<p>No People Soft Contact found. Please search Salesforce below using Name, Phone, Email, or other identifying information.</p>
  <apex:includeScript value="/support/console/22.0/integration.js"/>
     <script type="text/javascript">
        function testOpenPrimaryTab() {
          
        
            //Open a new primary tab with the salesforce.com home page in it
            sforce.console.openPrimaryTab(null,'{!pageUrl}', true, 
                'newContact', openSuccess, 'newContact');
        }
        
        var openSuccess = function openSuccess(result){
            //Report whether opening the new tab was successful
            if (result.success == true) {
               // alert('Primary tab can be opened');
            } else {
                //alert('Primary tab cannot be opened');
            }
        };
        
     </script>
 <apex:form id="frm">
                  
     <apex:pageBlock mode="edit" id="block">
 
         <apex:pageBlockSection id="pbSectn">
            <apex:pageBlockSectionItem id="pbSitem" >
               <apex:outputLabel for="searchText">Search Salesforce Contacts</apex:outputLabel> 
               <apex:panelGroup >
                  <apex:inputText id="searchText" value="{!searchText}"/> <br/><br/>
                  <apex:commandButton value="Search" action="{!search}" />
                   <apex:commandButton value="Clear" action="{!Clear}" />
                   <apex:commandButton value="Back" action="{!Back}"/>
                   <apex:outputPanel style="text-align:center" layout="block" >
           <apex:commandbutton value="New Contact" action="{!newcontact}" style="float: centre;"  rendered="true" onclick="testOpenPrimaryTab():return false;"/>
          <script>
            testOpenPrimaryTab();
            return false
           </script>
         </apex:outputPanel>
         </apex:panelGroup>
         </apex:pageBlockSectionItem>
        </apex:pageBlockSection>  
         <apex:pageBlockSection Title="Results" id="results" columns="1" rendered="{!IsShown}"  > 
          
         <apex:pageBlockTable value="{!contactResults}" var="c">
                  <apex:column headervalue="Name" > 
                       <apex:outputLink value="/{!c.Id} " >{!c.name}</apex:outputLink>
                  </apex:column>
                  <apex:column value="{!c.emplid__c}"> </apex:column> 
                  <apex:column value="{!c.Phone}" ></apex:column> 
                  <apex:column value="{!c.Email}" ></apex:column> 
                       
       </apex:pageBlockTable> 
   </apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
 </apex:page>
               

 

Best Answer chosen by Admin (Salesforce Developers) 
Maros SitkoMaros Sitko

you have keying mistake between testOpenPrimaryTab() : return false;, before return is ':' (colon) instead of ';' (semicolon)

All Answers

Maros SitkoMaros Sitko

maybe issue is in your onclick ( ';' instead of ':')
<apex:commandbutton value="New Contact" action="{!newcontact}" style="float: centre;" rendered="true" onclick="testOpenPrimaryTab();return false;"/>

BeatofHeartBeatofHeart

Can you little more specfic i didnt get this.

 

Thanks.

Maros SitkoMaros Sitko

you have keying mistake between testOpenPrimaryTab() : return false;, before return is ':' (colon) instead of ';' (semicolon)

This was selected as the best answer
BeatofHeartBeatofHeart

you are right it worked. there is an issue in return false.