2

I've added a custom field to the Case standard object which is a lookup to Account, named Site__c

When I create a visualforce page to allow for editing of the Site__c and Account fields on a Case, they are rendered slightly differently. The (Standard) Account field has a clear button and the text input is disabled, but i can't get the Site__c field to match.

How can I achieve this? ![example] http://imgur.com/Jevpwcx

VF:

    <apex:inputField id="Customer" label="Account" value="{!caseRec.AccountId}" style="width: 75%;" >
        <apex:actionSupport event="onblur" 
            action="{!assignAccountId}" 
            rerender="pbSection,pgButtons,PageBlock,caseProfile" />
    </apex:inputField>
    <apex:inputField id="Site" label="Site" value="{!caseRec.Site__c}" style="width: 75%;" >
        <apex:actionSupport event="onchange" 
            action="{!selectmethodSite}" status="loadStatus"
            rerender="pbSection,msg,caseProfile"/>
    </apex:inputField>
1

The clear button near Account shows that the field is part of lookup filter.

If you want your custom lookup to have the same clear button, your custom lookup should be part of any lookup filter.

Lookup filter documentation

Hope it helps.

| improve this answer | |
  • there is no filter on the Case.Account field, and adding one to the Site__c field doesn't change the appearance. – kingmunkyman Jul 7 '15 at 11:54
  • I have updated my answer. Account is part of any lookup filter on case object. That's why it got that clear button. – Vigneshwaran G Jul 7 '15 at 12:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.