2

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.

4
  • 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
    Commented Mar 30, 2020 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. Commented Apr 11, 2020 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. Commented Apr 16, 2020 at 17:23
  • We've hit the same issue when trying to install a 2GP managed package we created. There's not a lot of useful information out there about this issue at the moment :(
    – Phil W
    Commented Jun 26, 2020 at 10:33

0

You must log in to answer this question.