I tried this code i m getting error like this
"List has no rows for assignment to SObject"
public class delrecords {
public string cid{get;set;}
public list<contact> conlist{get;set;}
public contact con{get;set;}
public list<contact> getcontacts(){
conlist = [select id,firstname,lastname,email from contact where (owner.id =: userinfo.getuserid())];
return conlist;
}
public void deletecon(){
con = [select id,firstname,lastname,email from contact where id=:cid];
delete con;
}
}