• Sreechu
  • NEWBIE
  • 0 Points
  • Member since 2014


  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 1
    Likes Given
  • 2
    Questions
  • 2
    Replies
I am writing a unit test class in which the original class methods submit a record for approval; then they query like this :

[ select id, status, lastmodifieddate,lastmodifiedby.Name, isdeleted,createddate , createdby.Name, targetobjectId , (select Id, IsPending, ProcessInstanceId  , TargetObjectId , StepStatus, OriginalActor.Name , Actor.Name , RemindersSent from StepsAndWorkItems  order by createdDate desc, stepstatus asc)  from ProcessInstance  where TargetObjectId =:testRec.Id ]

the problem is the testRec was succesfully submitted for approval and the ProcessInstance records have Status as 'Pending'  but their children stepsAndWorkItems always return null.This does not happen when I use an original record and try the same in Executing_Anynomous_Window with a real record it gives me StepsAndWorkItems records. Please tell me what to do. Thanks

I am trying to use Tooling-API and query all Classes using this string: 

String soqlQuery = SELECT+Coverage,ApexClassorTrigger.name,ApexClassorTriggerId+FROM+ApexCodeCoverageAggregate+where+ApexClassorTriggerId+=+\'01pf0000000DHYYAA4\' 

This works fine and loads the particular class, BUT if I try :

String soqlQuery =
SELECT+Coverage,ApexClassorTrigger.name,ApexClassorTriggerId+FROM+ApexCodeCoverageAggregate+where+ApexClassorTriggerId+=+\'01p%\'

I get this error on page: " Malformed JSON: Expected '{' at the beginning of object "
Can anyone tell what is wrong ? or is it that LIKE clause cannot be used while constructing a Query ?

(This is later passed to : HTTPRequestInstance.setEndpoint(URL + soqlQuery); )
 

I am writing a unit test class in which the original class methods submit a record for approval; then they query like this :

[ select id, status, lastmodifieddate,lastmodifiedby.Name, isdeleted,createddate , createdby.Name, targetobjectId , (select Id, IsPending, ProcessInstanceId  , TargetObjectId , StepStatus, OriginalActor.Name , Actor.Name , RemindersSent from StepsAndWorkItems  order by createdDate desc, stepstatus asc)  from ProcessInstance  where TargetObjectId =:testRec.Id ]

the problem is the testRec was succesfully submitted for approval and the ProcessInstance records have Status as 'Pending'  but their children stepsAndWorkItems always return null.This does not happen when I use an original record and try the same in Executing_Anynomous_Window with a real record it gives me StepsAndWorkItems records. Please tell me what to do. Thanks

I am trying to use Tooling-API and query all Classes using this string: 

String soqlQuery = SELECT+Coverage,ApexClassorTrigger.name,ApexClassorTriggerId+FROM+ApexCodeCoverageAggregate+where+ApexClassorTriggerId+=+\'01pf0000000DHYYAA4\' 

This works fine and loads the particular class, BUT if I try :

String soqlQuery =
SELECT+Coverage,ApexClassorTrigger.name,ApexClassorTriggerId+FROM+ApexCodeCoverageAggregate+where+ApexClassorTriggerId+=+\'01p%\'

I get this error on page: " Malformed JSON: Expected '{' at the beginning of object "
Can anyone tell what is wrong ? or is it that LIKE clause cannot be used while constructing a Query ?

(This is later passed to : HTTPRequestInstance.setEndpoint(URL + soqlQuery); )
 

Hi All,

 

How can we add users into an existing Queue or newly created (in apex code) Queue in apex code?

Then I want to use that queue for an approval process which also created in apex code. How can I resolve this issue?

 

 

Thanks in Advance

Hi All,

 

How can we add users into an existing Queue or newly created (in apex code) Queue in apex code?

Then I want to use that queue for an approval process which also created in apex code. How can I resolve this issue?

 

 

Thanks in Advance