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
WikWik 

to write a soql query to list the opportunities whose status was first rejected and then approved

Hi,  

Please help me writing a soql query in Workbench  to list the opportunities whose status was first rejected and then approved.
I think the query would be on ProcessInstance object.
Ashish_SFDCAshish_SFDC
Hi , 


This is not directly possible. 

You have to create a field that stores the previous status of the opportunity and then you can run a report using both the fields. 

See the below links, 

https://developer.salesforce.com/forums?id=906F000000090GGIAY

https://success.salesforce.com/answers?id=90630000000gpJ5AAI


Regards,
Ashish