I have add custom button for salesforce's Sales application's 'Opportunities' tab. Once press that button I want to navigate some new tab (I have done it by adding proper URL) and execute following Apex method. How can execute this method. Thanks.
public class JobService {
private JobDao job_dao = new JobDao();
public void insertJob() {
Job__c newJob = new Job__c();
job_dao.insertJob(newJob);
}
}