+ Start a Discussion
FreddySFreddyS 

How to get a list of records from a related record's text ID formula field?

Hello all,
I have a tricky situation that I am stuck on. Ill try to explain this al best I can. So to start, I have 4 custom objects that I'm working with. 1. Task, 2. Allocation Summary, 3.Allocation Group,and  4.Allocation. Allocation is in a master detail with Allocation Group. Allocation Group has a master detail with Allocation Summary and Allocation Summary is in a lookup with Task. So in order from parent to child (Top to bottom) the objects go like this: Task is the very top, then Allocation Summary then Allocation Group and finally Allocation. 

Here is the scenario:
I have a formula on Allocation that pull the Task ID from Allocation Summary. (Text formula field)
Allocation looks up to User. 
1. I need to get a list of Task records based on Allocation and what user is on that Allocation record. So If I have two Allocation records one with bob and Task ID "xxxxxxxxxxxxx" and another with Joe with task ID "yyyyyyyyyyyyyy", have an apex controller (for visualforce page) to get the list of Tasks grouped by the user on the Allocation record. 

My overall goal is to create a visualforce page with a controller that shows a list of Tasks by the current logged in user so they can see the Tasks they are allocated to and no one elses. My thought was to somehow find all task records that match the text formula returning task ID's and get the task record infomation from there. 

(((((Does anyone know how to use an Apex controller to get a list of records that match a text formula returning ID's. )))))