【问题标题】:ROR error with Salesforce: The requested resource does not existSalesforce 出现 ROR 错误:请求的资源不存在
【发布时间】:2012-07-26 09:52:11
【问题描述】:

我正在使用 Ruby Gem“databascdotcom”将 Salesforce 集成到 Rails 应用程序中,一切正常。

但在第一次致电 salesforce 时出现以下错误:

**The requested resource does not exist**

如果我再次刷新 (Ctrl + F5) 页面,它可以正常工作,没有任何错误。

这是我的代码:

def SalesForceFeed
  @oppID = params[:oppid]

  client = Databasedotcom::Client.new client.client_id #=> foo client.client_secret #=> bar
  client.authenticate :username => "foo@bar.com", :password => "ThePasswordTheSecurityToken" #=> "the-oauth-token"
  client.materialize("Opportunity")
  begin
      @client=SalesForce::Connection.new.client
      @opp = Opportunity.find_by_Id(@oppID)
  rescue Exception=>e
    if(e.message == "The requested resource does not exist")
      return redirect_to :action => 'SalesForceFeed', :oppid => @oppID
    end
  end   

在第一次调用“SalesForceFeed”时,它返回错误“请求的资源不存在”,所以我添加了一个异常检查并再次调用“SalesForceFeed”,但我知道这不是正确的方法。

请建议我一个更好的方法来解决这个问题。谢谢。

【问题讨论】:

  • 最后我得到了问题,在物化中添加了一个错误的对象,我删除了它并修复了它

标签: ruby-on-rails rubygems salesforce databasedotcom-gem


【解决方案1】:

我终于解决了这个问题。在物化中添加了错误的对象。我删除了它并修复了它。

【讨论】:

  • 太棒了!您知道您可以将自己的回复作为答案,以便其他人受益。
  • 你能像之前和之后一样写出你的错误代码吗?
  • client.materialize("Opportunity") 被误写为client.materialize("Opportuniti"),所以对象名错误并报错
猜你喜欢
  • 2020-09-13
  • 1970-01-01
  • 2021-04-09
  • 2017-11-16
  • 2020-01-07
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多