• Upic Admin
  • NEWBIE
  • 0 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
Hi,  I've created a custom lookup field (HomeUW) in the Contact object that points to a custom table object.  I'm attempting to have the pop-up window in the search show more than just the "Name" column.

I've created an apex class controller as such to return the fields I'd like to see in the pop-up window:
public class GiftlinkLookupController {
    public String selectedGiftLinkId { get; set; }
    
    public List<GiftLink__c> giftLinkRecords() {
        return [SELECT Id, ZIP_Code__c, Name, City__c, State__c FROM GiftLink__c ORDER BY Name, ZIP_Code__c];
    }
    
    public PageReference selectGiftLink() {
        // Perform any actions you want with the selected GiftLink record (selectedGiftLinkId)
        return null;
    }
}
The visualforce page looks as follows:
<apex:page standardController="Contact">
    <apex:form>
        <apex:pageBlock>
            <apex:pageBlockSection title="Select a GiftLink">
                <apex:pageBlockTable value="{!giftLinkRecords}" var="gl">
                    <apex:column>
                        <apex:facet name="header">ZIP Code</apex:facet>
                        {!gl.ZIP_Code__c}
                    </apex:column>
                    <apex:column>
                        <apex:facet name="header">Name</apex:facet>
                        <apex:commandLink value="{!gl.Name}" action="{!selectGiftLink}">
                            <apex:param name="selectedGiftLinkId" value="{!gl.Id}" assignTo="{!selectedGiftLinkId}" />
                        </apex:commandLink>
                    </apex:column>
                    <apex:column>
                        <apex:facet name="header">City</apex:facet>
                        {!gl.City__c}
                    </apex:column>
                    <apex:column>
                        <apex:facet name="header">State</apex:facet>
                        {!gl.State__c}
                    </apex:column>                    
                </apex:pageBlockTable>
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>
I'm getting an error when trying to save the visualforce page that says :Unknown property 'ContactStandardController.giftLinkRecords'

What am I missing?  Is there a better way to do this?

Thanks.
Chris



 
Hi,  I've created a custom lookup field (HomeUW) in the Contact object that points to a custom table object.  I'm attempting to have the pop-up window in the search show more than just the "Name" column.

I've created an apex class controller as such to return the fields I'd like to see in the pop-up window:
public class GiftlinkLookupController {
    public String selectedGiftLinkId { get; set; }
    
    public List<GiftLink__c> giftLinkRecords() {
        return [SELECT Id, ZIP_Code__c, Name, City__c, State__c FROM GiftLink__c ORDER BY Name, ZIP_Code__c];
    }
    
    public PageReference selectGiftLink() {
        // Perform any actions you want with the selected GiftLink record (selectedGiftLinkId)
        return null;
    }
}
The visualforce page looks as follows:
<apex:page standardController="Contact">
    <apex:form>
        <apex:pageBlock>
            <apex:pageBlockSection title="Select a GiftLink">
                <apex:pageBlockTable value="{!giftLinkRecords}" var="gl">
                    <apex:column>
                        <apex:facet name="header">ZIP Code</apex:facet>
                        {!gl.ZIP_Code__c}
                    </apex:column>
                    <apex:column>
                        <apex:facet name="header">Name</apex:facet>
                        <apex:commandLink value="{!gl.Name}" action="{!selectGiftLink}">
                            <apex:param name="selectedGiftLinkId" value="{!gl.Id}" assignTo="{!selectedGiftLinkId}" />
                        </apex:commandLink>
                    </apex:column>
                    <apex:column>
                        <apex:facet name="header">City</apex:facet>
                        {!gl.City__c}
                    </apex:column>
                    <apex:column>
                        <apex:facet name="header">State</apex:facet>
                        {!gl.State__c}
                    </apex:column>                    
                </apex:pageBlockTable>
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>
I'm getting an error when trying to save the visualforce page that says :Unknown property 'ContactStandardController.giftLinkRecords'

What am I missing?  Is there a better way to do this?

Thanks.
Chris