1

I am trying to create an unmanaged package which has one custom object with lookup filter on a master detail field.

<fullName>Contact__c</fullName>
<externalId>false</externalId>
<label>Contact</label>
<lookupFilter>
    <active>true</active>
    <errorMessage>Contact must have a community user.</errorMessage>
    <filterItems>
        <field>Contact.IsPortalEnabled__c</field>
        <operation>equals</operation>
        <value>True</value>
    </filterItems>
    <isOptional>false</isOptional>
</lookupFilter>
<referenceTo>Contact</referenceTo>
<relationshipLabel>Account Group Users</relationshipLabel>
<relationshipName>Account_Group_Users</relationshipName>
<relationshipOrder>1</relationshipOrder>
<reparentableMasterDetail>false</reparentableMasterDetail>
<trackTrending>false</trackTrending>
<type>MasterDetail</type>
<writeRequiresMasterRead>false</writeRequiresMasterRead>

I tried to add name tag in lookup filter but it didn't work. Below error keeps coming:

GSD_CEP_Account_Group_User__c.Contact__c) LookupFilter should have a name during package installs.

I couldn't find any document for this if this is not allowed in packages.

  • Any update on this? I have the same issue and can't find any materials on it anywhere. The weird thing is this is happening when trying to create a package version for a package that depends on the package that includes this lookupFilter. Very weird... – Cappielung Mar 30 at 18:12
  • 1
    Are you using unlocked package ? It appears it's only occuring the first time, when the lookup filter doesn't exist yet in the target org. I created one manually, then all other deployments worked and updated the lookup filter correctly. – Fabien Taillon Apr 11 at 10:22
  • Well, I left the project before I could get to the cause but as mentioned by @fabien creating manually once before deploying seems to be feasible option knowing that Salesforce has some weird workarounds. – Ashish Sharma Apr 16 at 17:23

Your Answer

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

Browse other questions tagged or ask your own question.