Visualforce远程调用不使用safari

时间:2016-09-07 18:27:21

标签: safari salesforce visualforce

我正在使用angularjs和visualforce远程调用开发应用程序。

该应用程序适用于除Safari之外的所有浏览器。当应用程序在Safari浏览器上运行时,它无法与服务器通信 返回

“无法连接到服务器(通信失败)”。

代码段

Apex控制器

tilesConfigurer.setDefinitionsFactoryClass(TilesDefinitionsConfig.class);

Visualforce页面

global class UsaTAevaluationCtrl{

@RemoteAction 
   public static string getkeyvalue(string username,string key)
   {
      string interviewInviteId1;
       system.debug(username+'OOOOOOOOOO'+key);
       interviewInviteId1='False';

       Tech_Screen_Invites__c t=new Tech_Screen_Invites__c();
       try
       {
          t=[select id,name from Tech_Screen_Invites__c where Name=:username];
          string recordkey=t.id;
         if(t.id!=null)
           {
              interviewInviteId1=t.id;
             recordkey=string.valueof(t.id);
              if(recordkey.length()==18)
                  recordkey=recordkey.left(15);
              if(recordkey.right(3)==key)
                 interviewInviteId1=t.id;
           }
           else
           {}
       }catch(exception e){}

    return interviewInviteId1;
   }  
}

Angular Controller中的代码

<apex:page controller="UsaTAevaluationCtrl" showHeader="false" standardStylesheets="false" docType="html-5.0">
<apex:form >
// include statements
....

<script>
var services = (function(){
  return function (userName, password) {   

    var deferred = $.Deferred();
        Visualforce.remoting.Manager.invokeAction(
                '{!$RemoteAction.UsaTAevaluationCtrl.getkeyvalue}',
                userName,
                password, 
            function (result, event){
            console.log("Result -> ", result);               
        });
        return deferred.promise();        
    }

})()

</script>
....

<div class="container" ng-app="TechEval" ng-controller="evalform" ng-init="initEvent()">

<div class="row evaluation-row">
            <div class="col-md-12 col-xs-12">&nbsp;</div> 
        </div>
        <div class="row evaluation-row" ng-show="isAuthenticationSuccess">
            <div class="col-md-12 col-xs-12 alert alert-danger score-alert">Invalid Credentials</div> 
        </div>
        <div class="row evaluation-row">
            <div class="col-md-3 col-xs-12">
                <h1 class="skill-title">User Name</h1>
            </div>
            <div class="col-md-9 col-xs-12">                
                <div class="skill-new">
                    <input name='_username' id='userinput' ng-model='_username' required="required"></input>
                </div>
            </div>
        </div> 
        <div class="row evaluation-row">
            <div class="col-md-12 col-xs-12"></div> 
        </div> 
        <div class="row evaluation-row">      
            <div class="col-md-3 col-xs-12">
                <h1 class="skill-title">Token</h1>
            </div>
             <div class="col-md-9 col-xs-12">                 
                 <div class="skill-new">
                     <input name="_password" id="passvalue" type="password" ng-model='_password' required="required"></input>
                 </div>
             </div>
        </div>

<div class="row btn-row">
            <div class="col-md-3 col-xs-12">&nbsp;</div>
             <div class="col-md-9 col-xs-12">                 
                 <div class="skill-new">
                     <button class="btn btn-primary" style="margin-left:92px;" ng-click="Authentication()">Submit</button>
                 </div>
             </div> 
        </div>


</div>

</apex:form>

</apex:page>    

功能

当用户输入用户名和密码并点击提交按钮时,将调用远程服务。

1 个答案:

答案 0 :(得分:0)

如果您选中Supported Browsers for Salesforce Classic页面,则会找到:

  

Mac OS X上的Apple Safari版本8.x没有配置   Safari的推荐。不支持iOS上的Apple Safari   完整的Salesforce站点。不支持Safari:

     
      
  • Salesforce控制台
  •   
  • 使用低于4.0的CTI Toolkit版本构建的Salesforce CRM呼叫中心
  •   
  • Salesforce Wave Analytics
  •   

您确定您的OS / Safari版本与之兼容吗?