hi can someone help by telling me where i'm going wrong? I want to print the variable "cpf" in the vfp, but the develor doesn't find it. Starting now in salesforce, thanks for any help
Controller:
public class ImpressaoContratoController {
public String idOpp {get; set;}
public String tipoPedido {get; set;}
public Date datapagamento {get; set;}
public Date datacarregamento {get; set;}
public Decimal precototal {get; set;}
public transient DadosContratoVF_VO dadosContrato {get; private set;}
public List <OpportunityLineItem> oppProduct {get;set;}
public List <Opportunity> enderecoConta {get;set;}
public String formatacpf {get;set;}
String cpf;
public String formatacpf (String cpf){
return cpf.substring(0, 3) + '.' +
cpf.substring(3, 6) + '.' +
cpf.substring(6, 9) + '-' +
cpf.substring(9, 11);
}
public List <Opportunity> getEndereco(){
system.debug('idOpp= '+idOpp);
if(enderecoConta == null) {
enderecoConta = [SELECT Id, Recibidor_de_mercaderia__r.CEP__c, Recibidor_de_mercaderia__r.Rua__c,
Recibidor_de_mercaderia__r.Municipio__r.Name, Recibidor_de_mercaderia__r.Bairro__c,
Recibidor_de_mercaderia__r.Estado__c, Recibidor_de_mercaderia__r.Numero__c, owner.lastname,
owner.Email,owner.CPF__c
FROM Opportunity
WHERE Id =: idOpp
LIMIT 1];
}
cpf=formatacpf(enderecoConta[0].owner.CPF__c);
system.debug('cpf= '+cpf);
return enderecoConta;
}
VFP:
<div style="float: right"><br/><br/>
<table border="0" width="48%" >
<tr>
<th><b>Nome: </b></th>
<td><apex:outputField value="{!Endereco[0].owner.lastname}"/></td>
</tr>
<tr>
<th><b>CPF: </b></th>
<td><apex:outputText value="{!Endereco.cpf}"/></td>
</tr>
<tr>
<th><b>e-mail: </b></th>
<td><apex:outputField value="{!Endereco[0].owner.Email}"/></td>
</tr>
</table>
</div>