function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
AmansAmans 

Transaction control in Apex code

Hey guys
I m going through transaction control and savepoint feature of apex code and using global class and webservice keyword

webService Static Account[] roll_demo(String arg)
     {
          String[] ss = new String[]{arg};
          Account[] acc =  [select id,billingcity,name  from account where name='Aman'];
          insert acc;
          System.assertEquals(null,[select accountnumber  from  account  where id = :acc.Id].accountnumber);
      Savepoint sp = Database.setSavepoint();
          
          
          return acc ;
     }


so i get error , i m not sure of the cause but i had tried  by using public class also , but it didn't work

any one can suggest where  im commiting a mistake
thx
Aman Sehgal
TechOwlTechOwl

What is the exact error you are getting?