You need to sign in to do that
Don't have an account?
Contract & Legal Attachment section for standard Object Account records
public class ContractAttachment{
public Contract_Document__c vWDoc{get;set;}
public Attachment attachContract {get;set;}
public Account acct;
public ContractAttachment(ApexPages.StandardController stdController) {
acct = [SELECT Id, Name,RecordTypeId FROM Account WHERE Id = '001f000000gwjoO'];
RecordType rt =[Select Id,Name From RecordType Where SobjectType='Account' and Id ='012E00000001vtF'];
acct.RecordTypeId = rt.Id;
attachContract = new Attachment();
vWDoc = new Contract_Document__c();
this.vWDoc = (Contract_Document__c)stdController.getRecord();
acct.Id = vWDoc.Id;
}
public PageReference saveAttachment(){
vWDoc.Size__c = String.valueOf(attachContract.bodyLength/1024)+'KB';
insert vWDoc;
attachContract.ParentId =vWDoc.Id;
insert attachContract;
PageReference nextPage = new PageReference('/' + vWDoc.Id);
return nextPage;
}
}
The custom object Contract_Document__c is not seen in the Account Object. any suggestion?
All Answers