boyd_r URL Navigation for Custom Objects


/ Published in: Other
Save to your folder(s)



Copy this code and paste it in your HTML
  1. http://bit.ly/cj450K
  2.  
  3. //Get a reference to the Custom Object and gets its Key
  4. Schema.DescribeSObjectResult result = customObject__c.sObjectType.getDescribe();
  5.  
  6. //navigate to the View Page
  7. PageReference pageRef = New PageReference('/' + result.getKeyPrefix() + '/o');
  8. pageRef.setRedirect(true);
  9. return pageRef;

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.