If you are referring to the StandardController, this is the controller that is created when I created the customObject and I don't have (or at least know how to get to) the code for that.
If you are talking about the extension controller, here it is:
public class CEG_PL {
//public Opportunity oppty = new Opportunity();
//public Account acct = new Account();
private final CEG_Proposal_Letter__c pl;
public CEG_PL(ApexPages.StandardController stdController) {
this.pl= (CEG_Proposal_Letter__c)stdController.getRecord();
//oppty = [select id, name, st_id_1__c, st_id_2__c from opportunity where
opportunity.id= :ApexPages.currentPage().getParameters().get('Opportunity_id__c')];
//acct = [select id,name from account where
account.id= :oppty.accountid];
}
public string getPLID()
{
return
pl.id;
}
public boolean getAppDeposit_Selected_1()
{
return pl.AppDeposit_Selected_1__c;
}
public void setAppDepositSelected_1(boolean datain)
{
pl.AppDeposit_Selected_1__c = datain;
}
public PageReference checkForNullID()
{
if (
pl.id== null)
{
insert pl;
Pagereference ref = new Pagereference('/apex/CEG_Proposal_Letter_New');
ref.getParameters().put('id',
pl.id);
ref.setRedirect(true);
return ref;
}
return null;
}
public PageReference ReturnToOppty() {
return new PageReference('/' + ApexPages.currentPage().getParameters().get('id'));
}
public PageReference CreateCEGProposalPDF()
{
Pagereference ref = new Pagereference('/apex/CEG_PROPOSAL_DOC');
//string strID = '/apex/SBG_DOC_Request?id=' + (string)ApexPages.currentPage().getParameters().get('id');
ref.getParameters().put('id',ApexPages.currentPage().getParameters().get('opportunity_id__c'));
ref.setRedirect(true);
return ref;
}
}
Best
Joseph Murawski
Business Ops Analyst
U.S. Bancorp Equipment Finance
503-603-2902
Joseph.Murawski@USBank.com
3 answers