function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sandeep Rahul PVSandeep Rahul PV 

How the Campaign records can sharing in Partner Community?

Hello,

We are using Partner Community. As we know all community users have their contacts. We sharing the Lead records as follows.

In the contact Object, we have on Standard Object "Related Accounts" as a child.

User:Contact.RelatedAccount = Lead.Account_Name__c (Custom Account lookup field).

=====================================================
Now the requirement is.

If the user U1 login to the community portal and the user has access to four Leads (L1,L2,L3,L4) and 
the L1 is the campaign member of Campaign C1.
the L2 is the campaign member of Campaign C2. and 
the L3, L4 does not belong to any Campaign. Then

User U1 should see only C1 and C2 Campaigns, not other campaigns.

If the user U2 Login to the community portal and the user has access to few Leads (L8, L9) and 
the L8 is the campaign member of Campaign C2. and 
the L9 does not belong to any Campaign. Then

User U2 should see only C2 Campaigns not other campaigns.

Please help me to complete the requirement.

Thank you.
SwethaSwetha (Salesforce Developers) 
Hi Sandeep,
I think you can create a custom formula field on the Campaign object that will check if any of the leads associated with the campaign are visible to the current user. If any of the leads are visible, the formula field will return true, and if none of the leads are visible, it will return false.

Once the custom formula field is created, we can create a new list view on the Campaign object that filters campaigns based on the value of the custom formula field.

The filter criteria for the list view will be: Custom Formula Field equals true

Related:
https://salesforce.stackexchange.com/questions/215673/access-to-leads-for-customer-community-users
https://developer.salesforce.com/forums/?id=906F00000008qcGIAQ
https://trailhead.salesforce.com/trailblazer-community/feed/0D54S00000A869DSAR

Thanks