Skip to main content
typo in title
Link
glls
  • 20.3k
  • 19
  • 49
  • 83

please help me in finding the erroeerror

added 16 characters in body; edited tags
Source Link
Alex Tennant
  • 13.7k
  • 5
  • 58
  • 85

apexApex controller

I am trying to display related list contacts from displaycontact array..but, but when i amiIam using displaycontacts.name in vfmy Visualforce page.m I'm getting an error like.

Error: Unknown property 'recordPageCont.displayContacts' Quick 
Fix CreateQuick Fix Create Apex property 'recordPageCont.displayContacts' Quick 
Fix CreateQuick Fix Create Apex method 'recordPageCont.getDisplayContacts'

whatWhat is wri=ong inwrong with this?

iI tried with datalist table as well and still m getingI'm getting the same error.

apex controller

I am trying to display related list contacts from displaycontact array..but when i am using displaycontacts.name in vf page.m getting an error like

Error: Unknown property 'recordPageCont.displayContacts' Quick Fix Create Apex property 'recordPageCont.displayContacts' Quick Fix Create Apex method 'recordPageCont.getDisplayContacts'

what is wri=ong in this

i tried with datalist table as well and still m geting the same error

Apex controller

I am trying to display related list contacts from displaycontact array, but when iIam using displaycontacts.name in my Visualforce page I'm getting an error.

Error: Unknown property 'recordPageCont.displayContacts' 
Quick Fix Create Apex property 'recordPageCont.displayContacts' 
Quick Fix Create Apex method 'recordPageCont.getDisplayContacts'

What is wrong with this?

I tried with datalist table as well and still I'm getting the same error.

added 312 characters in body
Source Link
Vamsi Krishna Gosu
  • 10.5k
  • 5
  • 33
  • 50

<apex:page controller="recordPageCont">
<apex:form > <apex:pageBlock > <apex:pageBlockButtons > <apex:commandButton value="Edit" action="{!EditAccount}"/> <apex:commandButton value="Cancel" action="{!CancelButton}"/> </apex:pageBlockButtons> <apex:pageBlockSection > <apex:outputField value="{!objAccount.Name}"/> <apex:outputField value="{!objAccount.AccountNumber} "/> <apex:outputField value="{!objAccount.Type} "/> <apex:outputField value="{!objAccount.industry} "/> <apex:outputField value="{!objAccount.Rating} "/>

<apex:page controller="recordPageCont">  
  <apex:form >
  <apex:pageBlock >
  <apex:pageBlockButtons >
       <apex:commandButton value="Edit" action="{!EditAccount}"/>
       <apex:commandButton value="Cancel" action="{!CancelButton}"/>
  </apex:pageBlockButtons>
  <apex:pageBlockSection >
     <apex:outputField value="{!objAccount.Name}"/>
     <apex:outputField value="{!objAccount.AccountNumber} "/>
     <apex:outputField value="{!objAccount.Type} "/>
     <apex:outputField value="{!objAccount.industry} "/>
     <apex:outputField value="{!objAccount.Rating} "/>
    
     <b>Email</b> {!objAccount.Name}@salesforce.com
     <apex:outputField value="{!objAccount.Rating} "/>
  </apex:pageBlockSection>
  </apex:pageBlock>
  </apex:form>
  
<apex:pageBlock title="Contacts Related With {!objaccount.name}"></apex:pageBlock>

<apex:form >
<apex:outputPanel id="ContactDetail">
<apex:repeat value="{! displayContacts}" var="contact">
<p>{! contact.name & ' ' & contact.title}</p>
</apex:repeat>
</apex:outputPanel>

</apex:form>>
</apex:page>

</apex:pageBlockSection> </apex:pageBlock> </apex:form>

<apex:pageBlock title="Contacts Related With {!objaccount.name}"></apex:pageBlock>

<apex:form > <apex:outputPanel id="ContactDetail"> <apex:repeat value="{! displayContacts}" var="contact">

{! contact.name & ' ' & contact.title}

</apex:form>> </apex:page>

apex page

public class recordPageCont { public Account objAccount{get;set;} Public string recId{get;set;} Contact[] displayContacts {get;set;} public recordPageCont () { recId = apexpages.currentpage().getparameters().get('id'); objAccount =[SELECT Name, AccountNumber ,Type , Industry , Rating,(SELECT Name , MobilePhone,Title from Contacts) FROM account WHERE ID = :recId ];controller

public class recordPageCont {
public Account objAccount{get;set;}
Public string recId{get;set;}
Contact[] displayContacts {get;set;}
    public recordPageCont ()
    {
         recId = apexpages.currentpage().getparameters().get('id');
        objAccount =[SELECT Name, AccountNumber ,Type , Industry , Rating,(SELECT Name , MobilePhone,Title from Contacts) 
  FROM account
                        WHERE ID = :recId ];
                        
                        Account[] accts =[SELECT Name, AccountNumber ,Type , Industry , Rating,(SELECT Name , MobilePhone,Title from Contacts) 
                 FROM account
                 WHERE ID = :recId ];

Account acct = accts[0]; //acct.Contacts is a List if (!objAccount.Contacts.isEmpty()){ displayContacts = acct.Contacts;


Account acct = accts[0];
//acct.Contacts is a List<Contact>
if (!objAccount.Contacts.isEmpty()){
    displayContacts = acct.Contacts;
          
    }}
    
    
    Public pagereference Editaccount()
    {
        Pagereference edtaccount = new Pagereference('/apex/editaccount?id='+recid);
        edtaccount.setredirect(true);
        return edtaccount;
    }
    
    public pagereference cancelButton()
    {
        Pagereference cnclbutton = new Pagereference('/apex/accountdisplay');
        cnclbutton.setredirect(true);
        return cnclbutton;
    }
    
    
}

}

Error: Unknown property 'recordPageCont.displayContacts'
Quick Fix Create Apex property 'recordPageCont.displayContacts' Quick Fix Create Apex method 'recordPageCont.getDisplayContacts'

Error: Unknown property 'recordPageCont.displayContacts' Quick Fix Create Apex property 'recordPageCont.displayContacts' Quick Fix Create Apex method 'recordPageCont.getDisplayContacts'

<apex:outputPanel id="ContactDetail"> <apex:repeat value="{! displayContacts}" var="contact">

<apex:outputPanel id="ContactDetail">
<apex:repeat value="{! displayContacts}" var="contact">
<p>{! contact.name & ' ' & contact.title}</p>
</apex:repeat>
</apex:outputPanel>

{! contact.name & ' ' & contact.title}

<apex:page controller="recordPageCont">
<apex:form > <apex:pageBlock > <apex:pageBlockButtons > <apex:commandButton value="Edit" action="{!EditAccount}"/> <apex:commandButton value="Cancel" action="{!CancelButton}"/> </apex:pageBlockButtons> <apex:pageBlockSection > <apex:outputField value="{!objAccount.Name}"/> <apex:outputField value="{!objAccount.AccountNumber} "/> <apex:outputField value="{!objAccount.Type} "/> <apex:outputField value="{!objAccount.industry} "/> <apex:outputField value="{!objAccount.Rating} "/>

 <b>Email</b> {!objAccount.Name}@salesforce.com
 <apex:outputField value="{!objAccount.Rating} "/>

</apex:pageBlockSection> </apex:pageBlock> </apex:form>

<apex:pageBlock title="Contacts Related With {!objaccount.name}"></apex:pageBlock>

<apex:form > <apex:outputPanel id="ContactDetail"> <apex:repeat value="{! displayContacts}" var="contact">

{! contact.name & ' ' & contact.title}

</apex:form>> </apex:page>

apex page

public class recordPageCont { public Account objAccount{get;set;} Public string recId{get;set;} Contact[] displayContacts {get;set;} public recordPageCont () { recId = apexpages.currentpage().getparameters().get('id'); objAccount =[SELECT Name, AccountNumber ,Type , Industry , Rating,(SELECT Name , MobilePhone,Title from Contacts) FROM account WHERE ID = :recId ];

                    Account[] accts =[SELECT Name, AccountNumber ,Type , Industry , Rating,(SELECT Name , MobilePhone,Title from Contacts) 
             FROM account
             WHERE ID = :recId ];

Account acct = accts[0]; //acct.Contacts is a List if (!objAccount.Contacts.isEmpty()){ displayContacts = acct.Contacts;

}}


Public pagereference Editaccount()
{
    Pagereference edtaccount = new Pagereference('/apex/editaccount?id='+recid);
    edtaccount.setredirect(true);
    return edtaccount;
}

public pagereference cancelButton()
{
    Pagereference cnclbutton = new Pagereference('/apex/accountdisplay');
    cnclbutton.setredirect(true);
    return cnclbutton;
}

}

Error: Unknown property 'recordPageCont.displayContacts'
Quick Fix Create Apex property 'recordPageCont.displayContacts' Quick Fix Create Apex method 'recordPageCont.getDisplayContacts'

<apex:outputPanel id="ContactDetail"> <apex:repeat value="{! displayContacts}" var="contact">

{! contact.name & ' ' & contact.title}

<apex:page controller="recordPageCont">  
  <apex:form >
  <apex:pageBlock >
  <apex:pageBlockButtons >
       <apex:commandButton value="Edit" action="{!EditAccount}"/>
       <apex:commandButton value="Cancel" action="{!CancelButton}"/>
  </apex:pageBlockButtons>
  <apex:pageBlockSection >
     <apex:outputField value="{!objAccount.Name}"/>
     <apex:outputField value="{!objAccount.AccountNumber} "/>
     <apex:outputField value="{!objAccount.Type} "/>
     <apex:outputField value="{!objAccount.industry} "/>
     <apex:outputField value="{!objAccount.Rating} "/>
    
     <b>Email</b> {!objAccount.Name}@salesforce.com
     <apex:outputField value="{!objAccount.Rating} "/>
  </apex:pageBlockSection>
  </apex:pageBlock>
  </apex:form>
  
<apex:pageBlock title="Contacts Related With {!objaccount.name}"></apex:pageBlock>

<apex:form >
<apex:outputPanel id="ContactDetail">
<apex:repeat value="{! displayContacts}" var="contact">
<p>{! contact.name & ' ' & contact.title}</p>
</apex:repeat>
</apex:outputPanel>

</apex:form>>
</apex:page>

apex controller

public class recordPageCont {
public Account objAccount{get;set;}
Public string recId{get;set;}
Contact[] displayContacts {get;set;}
    public recordPageCont ()
    {
         recId = apexpages.currentpage().getparameters().get('id');
        objAccount =[SELECT Name, AccountNumber ,Type , Industry , Rating,(SELECT Name , MobilePhone,Title from Contacts) 
  FROM account
                        WHERE ID = :recId ];
                        
                        Account[] accts =[SELECT Name, AccountNumber ,Type , Industry , Rating,(SELECT Name , MobilePhone,Title from Contacts) 
                 FROM account
                 WHERE ID = :recId ];

Account acct = accts[0];
//acct.Contacts is a List<Contact>
if (!objAccount.Contacts.isEmpty()){
    displayContacts = acct.Contacts;
          
    }}
    
    
    Public pagereference Editaccount()
    {
        Pagereference edtaccount = new Pagereference('/apex/editaccount?id='+recid);
        edtaccount.setredirect(true);
        return edtaccount;
    }
    
    public pagereference cancelButton()
    {
        Pagereference cnclbutton = new Pagereference('/apex/accountdisplay');
        cnclbutton.setredirect(true);
        return cnclbutton;
    }
    
    
}

Error: Unknown property 'recordPageCont.displayContacts' Quick Fix Create Apex property 'recordPageCont.displayContacts' Quick Fix Create Apex method 'recordPageCont.getDisplayContacts'

<apex:outputPanel id="ContactDetail">
<apex:repeat value="{! displayContacts}" var="contact">
<p>{! contact.name & ' ' & contact.title}</p>
</apex:repeat>
</apex:outputPanel>
Source Link
Ankita Singh
  • 389
  • 1
  • 9
  • 30
Loading