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
anivesh muppaanivesh muppa 

usage of sqol statements are two here

Hi all,
can you please help me out with this problem that im geting the soql statements are two I have debug it but can't resolve it.Please correct it.


public class Accountinsert {
@auraEnabled
    public static void  Accs (string nam ,string id, boolean check){
        system.debug('inputs here ' +nam+' '+id+' '+check);
    account acc=[SELECT Id,Name,(select LastName,FirstName From Contacts) FROM Account WHERE Id =:id];
        
        acc.name = nam;
        update acc;
        if(check==true){
            delete acc.contacts;
            
        }
    }
User-added image
Thank you inadvance....!
Best Answer chosen by anivesh muppa
anivesh muppaanivesh muppa
i got it  :)