Apex code for tansaction/savepoint

by sunil ravulapalli /20. September 2014 05:32 / /Comments (0)
Savepoint sp = Database.setSavepoint();
try 
{
       insert residence;
       insert income;
       insert additionalIncome1;
} 
catch(DmlException e) 
{
       Database.rollback(sp);
       residence.Id = null;
       income.Id = null;
       additionalIncome1.Id = null;
       return null;
}
blog comments powered by Disqus