Solved my issue by switching to the Restforce Gem and researching the object relationships within the salesforce environment i was working with. :)
NoMethodError when assigning returned values to variables from a Salesforce SOQL query
-
22-06-2023 - |
Pergunta
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?
Solução
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow