You need to sign in to do that
Don't have an account?

SOQL Query Help
Hi All,
I need your help wiht a SOQL query. In a visualforce page, I need to show in a Visualforce page all the Approval Process Item that is assigned to a logged in user. I am trying to build a SOQL query for this, but finding it much more challenging than regular SOQL queries. Challenge is that I want to provide a link to the Record that is part of the Approval Process.
Could someone help me with a SOQL query that pulls all Approval items peding for the logged in user. Or even help me with the right direction.
Thanks,
Raghu
I need your help wiht a SOQL query. In a visualforce page, I need to show in a Visualforce page all the Approval Process Item that is assigned to a logged in user. I am trying to build a SOQL query for this, but finding it much more challenging than regular SOQL queries. Challenge is that I want to provide a link to the Record that is part of the Approval Process.
Could someone help me with a SOQL query that pulls all Approval items peding for the logged in user. Or even help me with the right direction.
Thanks,
Raghu
Then use myObjIds to query your custom object and do the data binding in your VF.
Note: Test.isRunningTest() will come in handy for unit test since in unit test it takes lots of effort to setup the approval processes.
Hope this helpes.
All Answers
Then use myObjIds to query your custom object and do the data binding in your VF.
Note: Test.isRunningTest() will come in handy for unit test since in unit test it takes lots of effort to setup the approval processes.
Hope this helpes.
SELECT CreatedById,ActorId,CreatedDate,IsDeleted,OriginalActorId,ProcessInstanceId,Id,SystemModstamp FROM ProcessInstanceWorkitem where actorid = : actorid
- Could you please eloborate this: use myObjIds to query your custom object and do the data binding in your VF.
- Using Test.isRunningTest(), you meant to say if we use this we do not have to set up approval process in Test classes? Just using this in the actual class will suffice?
Thanks a lot for your help again!Then in the VF, I just use Test.isRunningTest() to skip the process of setting up approval actor, plainly for code coverage, since the approval actor assignment is not in the controller scope anyway.