You need to sign in to do that
Don't have an account?
Joshua Ladle
Using Apex code to restrict community customers' access to certain records in a Custom Object based on criteria in picklist field of that same Custom Object
I've been told by Salesforce that I need to use Apex coding to do this (permission sets, sharing rules/sets, and validation won't work), but I'm am looking for some direction on how to do it.
I have a Custom Object called Properties that is a child to Accounts. My properties are shopping centers in South Florida in Palm Beach, Broward, and Miami-Dade Counties. The counties are values in a picklist field.
I'd like the community users to have visibility access to all the Properties located in each county that is selected in a Picklist (Multi-Select) field that is in the Contacts Object. Currently, without this structure, community users can see all Properties in all 3 counties.
Thanks in advance for any help you can offer.
I have a Custom Object called Properties that is a child to Accounts. My properties are shopping centers in South Florida in Palm Beach, Broward, and Miami-Dade Counties. The counties are values in a picklist field.
I'd like the community users to have visibility access to all the Properties located in each county that is selected in a Picklist (Multi-Select) field that is in the Contacts Object. Currently, without this structure, community users can see all Properties in all 3 counties.
Thanks in advance for any help you can offer.
"Using Apex code to restrict community customers' access to certain records in a Custom Object based on criteria in picklist field of that same Custom Object"
First thing, You can not restrict Access using Permission/Apex or any any other way. Restriction to record level Access will be drived based on Data Model. You need to have Private data model and then open up access based on requirement.
Also, I am not very clear that What you trying to do here. "I'd like the community users to have visibility access to all the Properties located in each county that is selected in a Picklist (Multi-Select) field that is in the Contacts Object."
Do you mean that based on picklist Selected by user Access will be drived ? Please add some more details to your question to help you.
Thank you !!
To clarify what I'm trying to accomplish.
Depending on what county or counties a community user desires access to, I would select those counties in a Picklist (Multi-Select) field in the Contacts Object. Then, based on what counties are selected in that picklist field, the community user would have visibility access to the Properties that are in that county.
Please let me know if you have any other questions. Thank you!
Thank you!
As per Your Requirement mention Above , You want to restrict access for user by selecting counties(piclklist Field) of Showing Properties respective with counties.
If i am not making mistake to understand your Question then i have some solution.
first thing You should create field depandency. Counties As a Controlling Field & properties as a Dependent Field. But As u says Conties is multi-select picklist field then multi-select picklist can be only dependent field.
try to modify conties datatype to picklist from multi-select picklist.
it can help.