Skip to content

Instantly share code, notes, and snippets.

@mailtoharshit
Created August 15, 2012 00:16
Show Gist options
  • Save mailtoharshit/3354149 to your computer and use it in GitHub Desktop.
Save mailtoharshit/3354149 to your computer and use it in GitHub Desktop.
How to use the method
pageParams = ApexPages.CurrentPage().getParameters();
string theId;
if (pageParams.containsKey('id')) {
theId = pageParams.get('id');
} else {
return null;
}
//now go look up the account using getObject method
Account toClone = (Account) DataUtils.getObject('Account', theId);
insert toClone;
//inserted the clone
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment