We have Custom Tab 'Approval Request' in our lightning application.The Purpose of this Tab is to display list of all the Pending Approval Process of all the objects.
If I want to query on ProcessInstanceWorkitem then I can query like this:
SELECT Id,ProcessInstanceId, ProcessInstance.TargetObjectId,
ProcessInstance.TargetObject.Name,
ProcessInstance.TargetObject.Type,
ProcessInstance.CreatedBy.Name,
ProcessInstance.CreatedDate,
from ProcessInstanceWorkitem
Similar Query we use it in our apex code.
I want to fetch the Parent Name of the Target Object so that whenever I Open the Approval Request then I can see the Parent Name of my Target Object Record.
e.g. I have a approval Request on Child object 'Potential Risk' of Parent Opportunity.So when I see the Potential Risk Record in Approval then it should display Parent Record Name which is Opportunity Name too.
I want to know if it is possible or not.As per the below link I am not able to get Parent Name of my Target object.
Can someone please suggest?