You need to sign in to do that
Don't have an account?
scriptagent
But when I try this:
I can compile the code, but then I get an error at the testRun, called:
Test ProcessInstanceWorkitem select statement
Hi,
I'm trying to write a testMethod for the select statement below.
Code:
ProcessInstanceWorkitem[] prInstWItem = [select Id from ProcessInstanceWorkitem where Id=:id_tmp]
But when I try this:
Code:
ProcessInstanceWorkitem pIw = new ProcessInstanceWorkitem(); insert pIw; ProcessInstanceWorkitem[] pIwQuery = [select Id from ProcessInstanceWorkitem where Id=: pIw.Id]; pIwId = pIwQuery[0].Id;
I can compile the code, but then I get an error at the testRun, called:
MIXED_DML_OPERATION, DML operation on setup object is not permitted after you have updated a non-setup object
What can I do to fix this problem ? Thank you very much in advance for any suggestion!
Peter
Just I read, that you can't create,update or delete a ProcessInstance Object (Apex Language Reference).
Have anybody an idea, how I although can test my code ?