0

I am working on something I thought would be pretty easy. My Idea was to calculate the win rate of the opportunity owner and display it in a field on the opportunity record. My first thought was an auto-launched flow would be pretty an easy way to look up all opportunities with the same owner ID. But it is throwing an error.

I then tried to test this with a SOQL query

SELECT ID, OwnerId FROM Opportunity WHERE OwnerId = "placeholderforID";

The query will not work either.

When I looked at the Owner Object in the workbench it showed a relationship with Opportunity but no child relationship name.

What am I doing wrong here?

10
  • The querry should work given that AddOwnerId is valid userId for that org, do you have opportunity teams enabled Commented Nov 21, 2018 at 20:50
  • No we do not. I never thought that would be the issue. Commented Nov 21, 2018 at 21:08
  • 3
    If AddOwnerId is a variable, you need an Apex bind with :AddOwnerId.
    – David Reed
    Commented Nov 21, 2018 at 21:20
  • 1
    What error are you receiving, Brooks?
    – David Reed
    Commented Nov 21, 2018 at 22:05
  • 1
    are you seeing malformed query error? single quotes, not double quotes.
    – krigi
    Commented Nov 21, 2018 at 22:07

1 Answer 1

2

single quotes, not double quotes. Try:

SELECT ID, OwnerId FROM Opportunity WHERE OwnerId = 'placeholderforID'

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .