+ 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