ROR与Salesforce错误:请求的资源不存在

编程入门 行业动态 更新时间:2024-10-28 11:22:35
本文介绍了ROR与Salesforce错误:请求的资源不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我使用Ruby Gemdatabascdotcom将Salesforce集成到Rails应用程序中,并且一切正常。

I am using the Ruby Gem "databascdotcom" to integrate Salesforce in a Rails app and all works fine.

但首次调用salesforce时出现错误:

But getting following error on first call to salesforce:

**请求的资源不存在**

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

If I refresh (Ctrl + F5) the page again, it works fine without any error.

以下是我的代码:

Here is my code:

def SalesForceFeed @oppID = params[:oppid] client = Databasedotcom::Client.new client.client_id #=> foo client.client_secret #=> bar client.authenticate :username => "foo@bar", :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时,它返回错误请求的资源不存在,所以我添加了一个excepton检查并再次调用SalesForceFeed,但我知道这不是正确的方法。

On the first call to "SalesForceFeed" it returned the error "The requested resource does not exist", so I added an excepton check and called "SalesForceFeed" again, but I know this is not the right way.

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

Please suggest me a better way to fix this. Thanks.

推荐答案

最后我得到了这个问题。物化中添加了错误的对象。我删除了它,它是固定的。

Finally i got the issue. There was a wrong object added in materialize. I removed that and it's fixed.

更多推荐

ROR与Salesforce错误:请求的资源不存在

本文发布于:2023-10-11 17:55:02,感谢您对本站的认可!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:不存在   错误   资源   ROR   Salesforce

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!