function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Felix Jong Seok ChaeFelix Jong Seok Chae 

create a list that contains a link to each case record

To create a list that has many links of other case records in a given case record, my plan is to create a custom field under the case object.
I'm developing this feature in apex developer console and I would first create a custome field in the salesforce. Does anyone know how to create a link to each case record in the field of the given case record?
Suraj PSuraj P
Would creating a report with all cases, and adding a formula field that is a hyperlink to the report on the case object work for you?
Felix Jong Seok ChaeFelix Jong Seok Chae
So is this how it should be done? (just overall plan)
1. create a report that has all cases
2. create a formula field on the case object
3. let that formula field be a hyperlink to the report

Will each record in the report have its own link to itself?
I also would like to know how the overall plan can be translated into apex code.

Thank you.
Suraj PSuraj P
That is correct. Each record in the report would have a link to the corresponding case as long as you add the Case Number column to it. Not sure what you mean by translating the plan to an apex code. Could you please elaborate, more so on why you want to translate it to an Apex Code?
I would suggest taking following approach:

1) First make sure you have an access to the field named "Parent Case" on case record. (If not then go to the page layout and then drag it on the page)
2) Now create a report on Case object. (Just go to the report and type CASE and choose that standard report type)
3) Now, drag these fields: "Case Number" and "Parent Case Number"
4) Now, set the Parent Case Number NOT Equal to 0
This is how your screen would look like,

User-added image

Then Hit the RUN button,.... here you have all the links attached with the report.

User-added image

Hope this helps!