Skip to Content

TheBlogReaders.com

Salesforce.com, PHP, MySQL, Javascript, Ajax, Htacces

How to return a PageReference to create a sObject in salesforce

Be First!
by February 21, 2013 APEX, SALESFORCE

 How to return a PageReference to create a sObject in salesforce

Using Static:
PageReference ref =  new PageReference(‘/a00/e’);

Using SObject:
public PageReference customObjectPageReference() {
Schema.DescribeSObjectResult R = YourCustomObject__c.SObjectType.getDescribe();
// Add /o to end of URL to view recent
return new PageReference(‘/’ + R.getKeyPrefix() + ‘/e’);
}

(511)

Previous
Next

Leave a Reply