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
Abhiman MungalAbhiman Mungal 

redirect to record detail page


User-added image
when i click on customer name that time i want to open that corresponding record detail in that particular object 
Abhiman MungalAbhiman Mungal
this screen shot record are from order__c and this customer name is from profile__c 
i try to fetch the record from profile that time its give me an error 
 
GauravendraGauravendra
Hi Abhiman,

Pass the id of reocrd from VF to apex controller.
In the apex method use PageReference to redirect to record detail page.
Example:
public PageReference recordDP(ID) {
        PageReference pg = new PageReference('/'+ID);
        pg.setRedirect(true);
        return pg;
    }

Hope this helps.
Sohan Raj GuptaSohan Raj Gupta
Hi Abhiman,

You can show Customer name as Link and add Profile__c object id with that.

I hope this will help you. If not, then share your code, so I will look into this.

Regards,
Sohan Raj Gupta