Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class updatecon{
- public id tobeEdited{get; set;}
- list<contact> lstcontact = [SELECT ID,name, Firstname,lastname,email,phone from contact];
- public void saveRecord(){
- Contact tobeupdated;
- for(Contact temp : lstcontact){
- if(temp.id==tobeEdited){
- tobeupdated = temp;
- break;
- }
- }
- update tobeupdated;
- tobeEdited = null;
- }
- }
- @istest
- public class testupdatecon{
- public static testMethod void testMyController(){
- updatecon update = new updatecon();
- update .saveRecord();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement