Question

Im Having an issue with the Databasedotcom ruby gem in trying to assign response values to global variables from a SFDC Soql query in a Ruby on Rails project.

I'm currently getting a NoMethodError on the CaseNumber part of the $_CASENUMBER variable.

Code

case_list = @@client.query("SELECT CaseNumber, Product__c FROM Case")
_case = case_list.first

$_CASENUMBER = _case.CaseNumber
$_PRODUCT = _case.Product__c

response = "The Case Number > #{$_CASENUMBER} and the Product is > #{$_PRODUCT}"
response.to_s

Now this code works fine when in just a plain Ruby script, but when in a rails environment it doesn't work. Any ideas?

Était-ce utile?

La solution

Solved my issue by switching to the Restforce Gem and researching the object relationships within the salesforce environment i was working with. :)

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top