public class Redirect_Main2 {
public List<Account> accs { get; set; }
public PageReference Redirect_Main(){
accs = [select id,name,phone,Industry from account];
return null;
}
}
Can you please Let me know if it helps or not!!!
If it helps don't forget to mark this as a best answer!!!
public with sharing class accsearchcontroller1 {
public Account accs ;
public List<selectOption> AccountNames{get;set;}
public String acid{get;set;}
public accsearchcontroller1(){
}
public List<selectOption> getAccountNames1() {
AccountNames = new List<selectOption>();
AccountNames.add(new selectOption('--none--','--none--'));
for(Account accs:[select id,name,phone,Industry from Account])
{
String sobjid = String.valueOf(accs.id);
String sobjName = String.valueOf(accs.name);
AccountNames.add(new selectOption(sobjid,sobjName));
}
return AccountNames;
}
public PageReference editbutton(){
System.debug('AccountNames: ' + acid);
Id i = Id.valueOf(acid);
System.debug(i);
return new PageReference('/'+i+'/e?retURL=/'+i);
}
}
Try this code :
VFP : Controller :
Can you please Let me know if it helps or not!!!
If it helps don't forget to mark this as a best answer!!!
Try this code
Vf: controller: