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
Answer
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
.
Attribution
Source : Link , Question Author : Prady , Answer Author : kenslewis