• Chrs85
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

How to insert process instance and processinstanceworkitem object in salesforce?

 

plz send .

 

my sample code:

 

public void ApprovalRequest()    {             

           ProcessInstance tempProcessInstance = new          ProcessInstance(Status='Pending',TargetObjectId='800U0000000HXxoIAG');        

                 insert tempProcessInstance ;                                            

  }          

 

error:

Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [Process Definition, Current Node]: [Process Definition, Current Node] .

 

process instance object cant have a Process Definition and Current Node.