function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SArunSArun 

Selecting OpportunityStage.SortOrder in SOQL query

 

SELECT NAME, STAGENAME

FROM Opportunity

 

I need to pick OpportunityStage.SortOrder in the above query and order the list based on it. Can someone provide me the SOQL to select  "OpportunityStage.SortOrder" in the above query

 

werewolfwerewolf

You can't get that information right in that query.  You can do another query for stages though, like

 

Select o.SortOrder, o.MasterLabel, o.IsWon, o.IsClosed, o.IsActive From OpportunityStage o