I have a Visualforce Page, on which I need to create Hyperlink and when user click the link it should redirect to Standard Recordtype page of a custom Object.

1 Answer 1


You can use this format:

 String objKeyPrefix = CustomObject__c.sObjectType.getDescribe().getKeyPrefix();
 Redirect to url in this format:
 where objectId is the id of the custom object you get from setup.
  • 1
    if we use the ent=objectId, will it work in all environments. because ID will be different for DEV,TEST and Prod right?
    – Shravan
    Commented May 19, 2016 at 21:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .