I Have two Lookup Fields on my XYZ Object

  1. Account(Controlling Lookup Field)
  2. Contact (Lookup Filter: "Contact:Account Id" equals "Account Id",as selected in above field)

when i select "MyAccount" & respective "MyContact" on rerender of some event it gives below errorjust below the contact field even though its satisfying the lookup filter criteria plus the record is also getting saved.,

MyContact Contact is no longer valid with your selections.

  • I think you have a contact-id on your object that has a parent account Id that is different to the account Id in your second lookup. Try to align the account id on the contact lookup and your object account lookup – max Jan 30 '14 at 8:57

Refer https://success.salesforce.com/issues_view?id=a1p30000000T4EkAAK this seems to be known issue in SFDC. kindly visit above link and click - this issues affects me, SFDC team will help out.

Thanks TJ

| improve this answer | |

So Sean Forbes has a parent account of Edge Communications - if you delete the account lookup on your object, there is no longer alignment between the account lookup id on your object and the account lookupup id on the Sean Forbes contact record

enter image description here

enter image description here

| improve this answer | |
  • Hi Max, you are right. But i am not deleting the account still its giving the same error on rerender plus the record is also getting saved. – snehakem Jan 30 '14 at 9:13
  • @snehakem So can you confirm that the account id lookup on the contact record exactly matches the account lookup id of your object for the problem record? – max Jan 30 '14 at 10:06
  • Ya i did confirm.The selected contact is the child contact of the selected Account. If it had not been matching then record wouldn't have been saved. but the record is saving. – snehakem Jan 30 '14 at 10:06

We had the same problem with an Account lookup that would populate a Contact lookup, and the warning message would appear even though the Contact matched the Account. We solved it by wrapping the standard inputField for the Contact within an outputPanel (and pageBlockSectionItem) as below:

<apex:pageBlockSectionItem helpText="{! $ObjectType.My_Object__c.fields.Account__c.inlineHelpText }">
    <apex:outputLabel value="{! $ObjectType.My_Object__c.fields.Account__c.label }" for="accountLookup" />
    <apex:actionRegion >
        <apex:inputField value="{! myObject.Account__c }" id="accountLookup" required="true">
            <apex:actionSupport event="onchange" action="{! setContactFromAccount }" reRender="contactId" />
<apex:pageBlockSectionItem helpText="{! $ObjectType.My_Object__c.fields.Contact__c.inlineHelpText }">
    <apex:outputLabel value="{! $ObjectType.My_Object__c.fields.Contact__c.label }" for="contactLookup" />
    <apex:outputPanel id="contactId">
        <apex:inputField value="{! myObject.Contact__c }" id="contactLookup" />
| improve this answer | |

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.