Slash Before Quote - Merge or Query Building Issue?

  • 1
  • Question
  • Updated 3 months ago
  • In Progress
When attempting to query CaseComments by ParentId, I'm running into an issue with the model conditions. According to the error, it appears that an 18 character Id is being passed to the SOQL query, which would be fine if it was enclosed in single quotes. My troubles occur when I try to set that condition in an action to have the single quotes on either side of the Id. The error indicates that a \ is inserted before the single quotes.
Photo of David Lin

David Lin

  • 516 Points 500 badge 2x thumb

Posted 7 months ago

  • 1
Photo of Mike Dwyer

Mike Dwyer

  • 3,330 Points 3k badge 2x thumb
I'm not sure you need to supply the quotes if you are using the field name Id, or the merge syntax version {{Id}}. (I'm trying to visualize how you are setting up the condition; a screen shot or the XML <condition>...</condition> line might be helpful.

That said, if you are using the merge syntax with double braces, try changing to triple: {{{Id}}}

Also, if ParentId in CaseComments is similar to the Attachment object, you may not be able to "get there from here." The object-oriented relationships between some of those objects is not what a relational database approach expects.
Photo of David Lin

David Lin

  • 516 Points 500 badge 2x thumb
I'm much more interested in whether or not the single quotation in string can be passed into the SOQL query without the /. The query works with the single quotations.