Pregunta

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?

¿Fue útil?

Solución

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

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top