Filter Data Access with Restriction Rules

Should you switch to the Salesforce industry? - Salesforce coding lessons  for the 99%

Did you know that there is a new feature that allows you to filter access to records in a completely new way, historically granted access to Salesforce staff records with role sharing patterns across the organization, and some advanced settings like territory management?

So here within Addison measly, Salesforce org, and today, Addison measly is working on a company called unlimited auctions.

Now there are a variety of different types of auctions in unlimited auctions, including international auctions, federal auctions, and state auctions. Now, because of compliance at the state level, it’s really important that state auctioneers can only see state auctions.

And since Addison has already configured record types for each kind of auction, we’ll create a restriction rule that allows the state auctioneers to only see the record type of state auction. So let’s head up. From setup, navigate to the object manager. Use the quick search box to type the field you want.

On the left-hand side, you’re going to look for the Restriction Rules.
When you click on the Restriction Rules, you’ll get this great explanation of what the Restriction Rules do and how they combine with the sharing and sharing patterns throughout the organization.
And then it shows you that at the end of the day, what you have are filtered records.

 

When records are filtered by Restriction Rules, Addison goes into creating a new rule, and we’ll call these state auctioneers, we’ll call the description, “State auctioneers can only see state auctions.”

 

 

Choose the type of criteria, they can be permission-based or user-based.
What will be demonstrated now, is to be user-based at the user level.
Addison has set up a field that dictates whether or not a user is a state auctioneer, and this is a checkbox, and it will tell you that someone is a state auctioneer.

In other words, if the state auctioneers checkbox on the user’s record is true, then we want to restrict it.
We need to specify which records we want that user to be able to see. And I’m going to use the name of the record type this way, the way I’m going to do it is by clicking on the record type ID. And from here you’re going to select the name and the field to choose.

 

 

Choose the record type name over the record type ID is that ideas can vary from environment to environment. If we are working in sandboxes, which we should be doing all the time, I prefer record-type names because the name stays consistent. So in this. We want to specify the records that the user is allowed to see, and those would be, uh, you, those would be records that have the state auction record type name.
So we enter, the state auction. We click save.
All the fields have been filled in, now one will navigate to a user and log in.

 

Click on the users.
Click on the userCook,Cori. I’m going to go in as Cook,Cori who is a state auctioneer, Let’s take a look at all the auctions. And now we can see from this perspective, that the only auction that shows up is the state auction.

This means that our auction, the restriction rule, has been driving the federal auction and the international record-type auctions, of which we have a record of each.

Nubik • Articles and Videos Resources

 

Some considerations to keep in mind:

  • If you are going to use restriction rules first, keep in mind that you want to use restriction rules. If you want certain users to see only a specific set of records, (and when you are configuring), you need to remember that restriction rules are only available for custom objects.
  • For tasks and events, you can have two restriction rules per object.If you are currently in an enterprise or org development edition, if you are running or in an additional unlimited org, you can have up to five restriction rules per object.

 

cropped-medium-3

The Complete Guide to Flow Trigger Explorer

Salesforce created Record-Triggered Flow to trigger Flow functionality automatically when a record event (create, edit, or delete) occurs. As with Apex and Process Builder, the single best practice when creating

 3,362 total views

Read More »