Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
How do i query for all opportunities which has the type "Closed/won" on opportunityStage not the stage "Closed/Won". We have a few stages which are of Type Closed/Won but not with the stagename as closed/won
Use the IsWon field in your SOQL condition expression. For example,
SELECT Id, Name FROM Opportunity WHERE IsWon = TRUE
will return all Opportunities with any StageName of Type Closed/Won.