For 1st Part
1st Method:
Create a Button with Onclick Javascript and add the below code in it.
{!REQUIRESCRIPT("/soap/ajax/30.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/30.0/apex.js")}
window.open("/apex/YOUR_VF_PAGE_NAME?id={!Account.Id}", "_self", "toolbar=yes, location=yes, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=no, copyhistory=no, width=650, height=650");
2nd Method:
You can put a direct VF Page by choosing the URL Option in the Custom Button Edit Page and place the below url
/apex/YOUR_VF_PAGE_NAME?id={!Account.Id}
For 2nd Part
VF Page:
<apex:page sidebar="false" standardController="Account" extensions="aaaController">
<apex:form >
<apex:pageBlock id="block3">
<apex:pageBlockButtons >
<apex:commandButton action="{!ProcessSelected}" value="Save the Contact in Account Field"/>
</apex:pageBlockButtons>
<apex:pageBlockSection columns="2">
<apex:pageBlockTable value="{!wrapContactList}" var="waccl">
<apex:column >
<apex:facet name="header">
<apex:inputCheckbox />
</apex:facet>
<apex:inputCheckbox value="{!waccl.isSelected}" id="InputId">
<apex:actionSupport action="{!CheckBoxSelect}" event="onchange" reRender="block2,block3">
<apex:param name="ConId" value="{!waccl.cont.Id}" assignTo="{!ConId}"/>
</apex:actionSupport>
</apex:inputCheckbox>
</apex:column>
<apex:column value="{!waccl.cont.LastName}"/>
</apex:pageBlockTable>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
Apex Class Controller:
public class aaaController {
public Id ConId{get;set;}
public list<wrapContact> wrapContactList {get;set;}
public list<Contact> selectedContacts{get;set;}
public Id AccId{get;set;}
public aaaController (ApexPages.StandardController controller){
wrapContactList =new list<wrapContact>();
AccId = ApexPages.currentPage().getParameters().get('Id');
for(Contact c:[Select Id, LastName from Contact where AccountId =: AccId]){
wrapContactlist.add(new wrapContact(false,c));
}
}
public void CheckBoxSelect(){
selectedContacts=new list<Contact>();
System.debug('ConId=====>'+ConId);
for(wrapContact wc : wrapContactList){
if(ConId == wc.cont.Id){
selectedContacts.add(wc.cont);
}
else{
wc.isSelected = false;
}
}
System.debug('wrapContactlist====>'+wrapContactList);
}
public PageReference ProcessSelected(){
selectedContacts=new list<Contact>();
for(wrapContact wrapobj:wrapContactlist){
if(wrapobj.isSelected==true){
selectedContacts.add(wrapobj.cont);
}
}
Account acc = new Account(id=AccId);
acc.Description = selectedContacts.get(0).LastName;
update acc;
PageReference pr = new PageReference('/'+AccId);
return pr;
}
public class wrapContact{
public Contact cont{get;set;}
public boolean isSelected{get;set;}
public wrapContact(boolean isselect, Contact a){
cont=a;
isselect = isSelected;
}
}
}
NOTE: I have given the Description Field to be updated in Account with Contact Name in it. Please Change the things according your scenario...
Hope this might helps...