0

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

0

You can use this format:

 String objKeyPrefix = CustomObject__c.sObjectType.getDescribe().getKeyPrefix();
 Redirect to url in this format:
 https://mydomain.my.salesforce.com/setup/ui/recordtypeselect.jsp?ent=objectId&retURL=%2FobjKeyPrefix%2Fo&save_new_url=%2FobjKeyPrefix%2Fe%3FretURL%3D%252FobjKeyPrefix%252Fo
 where objectId is the id of the custom object you get from setup.
1
  • 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 .