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

How to fetch the field values of ProcessInstance
Hi,
I have a requirement, where in I need to assign the text that is present in Comments field of Steps in ProcessInstance to Approved Comments field of Opportunity. So, kindly suggest a solution to the above mentioned problems.
Trigger:
trigger ApprTrigger on Opportunity (after insert,before update) {
Opportunity [] o = Trigger.new;
ApprProcess.ProcessInst(o);
}
Apex Class:
The reference site that I have used is http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_erd_process.htm
When I am saving the above class I am getting the following error.
Error: Compile Error: Invalid foreign key relationship: ProcessInstance.ProcessInstanceStep at line 12 column 27
So, can anyone suggest a solution for the above mentioned problem.
Regards
Arun
Arun,
You are pulling a child object in the original query. In order to traverse the relationship, you have to build a list of the child steps:
This should allow you to save the trigger.
Hope this helps
Jay