function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
niladri_3121niladri_3121 

Not getting the search button & checkbox on the VF page by retriving from extention

VF Page

<apex:page standardController="Account" recordSetVar="accounts" tabstyle="account"
sidebar="false" >
<apex:form>
<apex:pageBlock >

<apex:pageBlockTable value="{!accounts}" var="a">
<apex:column value="{!a.name}"/>
<apex:column value="{!a.Account_Priority__c}"/>
<apex:column value="{!a.Account_Region__c}"/>
<apex:column value="{!a.Account_Summary__c}"/>
<apex:column value="{!a.SLA__c}"/>
<apex:column value="{!a.Id}"/>
<apex:column value="{!a.Phone}"/>
<apex:column value="{!a.AccountNumber}"/>


<apex:inputCheckbox value="{!Limit to access I won}"/>

</apex:pageBlockTable>

<apex:pageBlockButtons >
<apex:commandButton value="Save" action="{!save}"/>
</apex:pageBlockButtons>

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

 

Controller

public class datacon3{

public PageReference Search() {
return null;
}


public String getLimit() {
return null;
}


private final Account account;


public datacon3() {
account =[SELECT Name,AccountNumber,Phone,SLA__c,Account_Summary__c,AccountID,Account_Priority__c,Account_Region__c FROM Account
WHERE Id =:ApexPages.currentPage().getParameters().get('id')];

//

Error: datacon3 Compile Error: No such column 'AccountID' on entity 'Account'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names. at line 17 column 26 

 

}
public Account getAccount(){
return account;
}


public PageReference save(){
update account;
return null;
}
}

//we are not getting a custom search button in visualforce page & a checkbox.The error what we got also i have mentioned inside the code.

                        please help us by rectifying the error.
Best Answer chosen by Admin (Salesforce Developers) 
Avidev9Avidev9
Well the error is self explanatory!.
There is no field names "AccoutID" in Account and you are querying for the same in SOQL.

Just change your query, I guess you wanted to use "Id" instead of "AccountId".

The query should be (make sure all other field exists in Account)

account =[SELECT Name,AccountNumber,Phone,SLA__c,Account_Summary__c,Id,Account_Priority__c,Account_Region__c FROM Account
WHERE Id =:ApexPages.currentPage().getParameters().get('id')];

All Answers

Avidev9Avidev9
Well the error is self explanatory!.
There is no field names "AccoutID" in Account and you are querying for the same in SOQL.

Just change your query, I guess you wanted to use "Id" instead of "AccountId".

The query should be (make sure all other field exists in Account)

account =[SELECT Name,AccountNumber,Phone,SLA__c,Account_Summary__c,Id,Account_Priority__c,Account_Region__c FROM Account
WHERE Id =:ApexPages.currentPage().getParameters().get('id')];
This was selected as the best answer
niladri_3121niladri_3121

Thank you for the response.

Niladri