You need to sign in to do that
Don't have an account?
Mallik Vemugunta
Custom Account update button on contacts
I had the below code to display the selected contacts from the account page related list, looks like my !selected is not working, can someone help on this.
<apex:page StandardController="Contact" recordSetVar="contacts">
<apex:form >
<apex:pageblock >
<apex:inputText value="{!Contact.AccountId}"/>
</apex:pageblock>
<apex:pageBlock >
<apex:pageBlockTable value="{!selected}" var="c">
<apex:column value="{!c.firstname}"/>
<apex:column value="{!c.lastname}"/>
<apex:column value="{!c.Account.Name}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>
<apex:page StandardController="Contact" recordSetVar="contacts">
<apex:form >
<apex:pageblock >
<apex:inputText value="{!Contact.AccountId}"/>
</apex:pageblock>
<apex:pageBlock >
<apex:pageBlockTable value="{!selected}" var="c">
<apex:column value="{!c.firstname}"/>
<apex:column value="{!c.lastname}"/>
<apex:column value="{!c.Account.Name}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>
All Answers
The {!selected} value responds to the records selected on the previous page. This is intended to be used when loading a Visualforce page from a List Button.
Note: I copied and pasted your 2nd page block into a Visualforce page, loaded it from a List Button, and it worked perfectly.
I will be happy to help however I can, but I'm not 100% sure my understanding of your goals are correct. If you can provide more information I'll do my best to help you get this up and running.
I choose the account that had 2 contacts and after selecting the contacts I clicked the new Account Update button and I am not getting any data displayed.
2. Your code worked for me. I did exactly what you mentioned, with your code, and it worked (except for the account id textbox).