我正在使用Ruby Gem「databascdotcom」將Salesforce集成到Rails應用程序中,並且所有工作都正常。Salesforce發生ROR錯誤:請求的資源不存在
但要在第一次調用以下錯誤銷售人員:
**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 => "[email protected]", :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」了,但我知道這不是正確的方法。
請給我一個更好的解決方法。謝謝。
終於我得到了問題,在物化中添加了一個錯誤的對象,我刪除了它,並且它的固定 – 2012-07-26 13:47:16