Sharing rules as part of the sales full security more than we already discussed about the profiles permission
said all the beauty and all hierarchy.
Now it's time for us to understand more about sharing rules and as we already know sharing rules also
provide a record level access and sales force based on this pictorial representation which we already
discussed before.
This is basically a representation of how we can open up access and sales force so it starts with all
the beauty which provides the most restrictive access record level access which can still more be opened
up by whole hierarchy which can still more be opened up by sharing rules so basically sharing rules
comes into picture when we want to share records to a group of users so then we say like sharing records
with a group of users they have to understand like how it works and based on which criteria which factors
it works we can broadly divide sharing tools in these five different categories owner based sharing
rules criteria based sharing rules manual sharing or user records sharing and finally Epix managed sharing.
These are the five different methods of sharing records with another group of users.
We'll be discussing about the first four types of sharing rules in this course.
However apex to manage sharing we wouldn't be discussing as part of the schools but because it is more
related to Apex.
But it is always good to know that there is another type of sharing which also exist where Apex so coming
to the first one that is on a base sharing rules.
In this video we learn about what's on a base sharing rules and how it do be implemented.
Salesforce so sharing rules.
As I already mentioned they are basically used to open up the record level access based on rules the
rules and subordinates are based upon certain criteria and sharing rules comes into picture then order
beauty is either private or public read only right.
We know that if all the beauty of a particular object is public read write what does it mean.
It means that we have complete control on those records.
We have full access on all those records.
Then all the beauty and it's life giving the full access to all those records.
Then there are no real usage of the other methods of sharing that is at all hierarchy or sharing rules.
No we don't need that right because ordered the United Self is giving us the full access but in scenarios
then all W-2 is a restrictive say private vet and we have no access or public read only that and we
have only read access to others records in those scenarios.
Values sharing rules sharing rules.
Basically there's honor based and criteria based.
So what is the difference between honor based sharing rules and criteria based sharing rules as the
name says owner based meaning it is based on the owner.
That is the record owner criteria based meaning it is based on the criteria based on the record field
values say for example.
I am I want to share records of a particular owner to another group of users then it is owner based
sharing Jules but criteria based means I want to transfer I want to shares a particular set of records
there.
The country is the United States or where the status is set to complete it are some different field
value or the probability is a different field value so in that scenario then we use criteria based so
we win and we want to share that of course based on the record owner.
We go for owner based sharing rules and vendor sharing of the records has to be based on a field value
in the record.
Then we go for criteria based sharing routes perfect.
So now I think the basic concept is clear.
Let's consider a quick business scenario.
I would like to share all the records of users with the roll customer support international customer
support United States all right.
Just consider the two different rules.
That's it.
So to have a better understanding and visibility of this requirement let's quickly go to our developer
Rog and go for the rules.
So go to rules and expand all you can see the entire hierarchy.
I haven't modified anything as such.
This is the default rule hierarchy that we have in sales plus development edition because we are more
concerned to learn about the techniques here and not about configuring any of these but in real time.
Don't expect these rules to be completely based on the company's old hierarchy.
Alright so now the business scenario is you can see in the rule hierarchy there are two different rules.
That is customer support international and customer support.
North America and as you can see in the hierarchy they are at the same level right.
They are not reporting to each other.
They are at the same level and the old hierarchy.
So consider the scenario all publicity is private meaning we cannot see others at cards so no one can
see those guards as simple as that and then comes a whole hierarchy right and that does all over pictorial
representation is the order of your day is private.
And then comes it all hierarchy for role hierarchy.
Assume that for that particular object the grant access using hierarchies is set to true perfect.
But will that help in the scenario it owned.
Why.
Because both the rules are in the same level and the hierarchy right.
The grant level grant access using hierarchy is only work when rules are reporting to each other.
Say for example in this scenario the SVP customer service and support will automatically get access
to all the records owned by these people but our scenario is different.
Our scenario like we are talking about two different trolls who are on the same level in the hierarchy
social hierarchy will not help so the next option for us is sharing rules.
So sharing rules we are going to use to share some set of records with the group of users.
And as we already learned it can be based on the owner or it can be based on some criteria.
In our scenario to share all records of users with the role as customer support on international.
So basically Records owned by this particular role has to be shared with another role.
So in that scenario we'll be using owners based sharing rules.
This is a scenario that we were just talking about.
So the scenario is the order beauty is private and we have to use us here in real time.
We have a number of users.
But in Devil operation we know that we can have only two users so we have two users and for one of the
use of the profile a system administrator because definitely we need to have a system administrator
and we cannot update the profile of the zoo's isolated B access system administrator and thus users
of all this customer support international use it to profile as a custom profile and add all this custom
support.
United States Alright so this is other scenario.
So in this scenario as the order beauty is private we can see each of those at a card but this is an
exception the system administrators are definitely not the best profile to consider why we are testing
are y doing P will cease because system administrator basically has access to every single thing in
Salesforce however we have no other option because one if they use it as a system argument but this
this scenario would be even more clear if it had been a different profile.
However we can definitely learn sharing rules with the scenario itself.
OK so as now as the order beauty of opportunity is private it means that all the cards owned by these
user will not be accessible by user to write.
Asim blessed that we know that.
So let's go quickly check that out.
I'm in the order beauty settings and I have set the order beauty of opportunity to private.
This is the scenario that we have created.
And we have to use us one as system administrator.
The other is a custom profile.
And update the role of the system administrator to be customer support international and update that
all of those user to be customer support the United States.
Now what we're going to do this all the records.
This is it.
I generally am the primary user that I use so all the cards are created in the ARG is basically owned
by the fullest user.
But of course you can create records based on this user aspect.
So what I'm going to do this I'm going to log in as user 2 and I'm going to see if I am able to see
any records on the BI User 1 Obviously I shouldn't be because all the beauty is set to private.
However let's quickly check it out.
I have now logged in as a second user and I'm an opportunities I go for all opportunities.
I do not see any opportunities.
Why.
Because all the opportunities that is there in the system is owned by user 1.
I can create new opportunities which I would be able to see.
However I am not able to see all those opportunities because the order beauty is set to private.
So this is a requirement and this is how the scenario is.
So not to solve does requirement What do you do.
Vigo for owner based shit in jewels so how what are we going to define our sharing.
We are going to define them as sharing rules in such a way that share all the records owned by one particular
role to another role and here we are going to say that share all the opportunities owned by this particular
old customer support international to this particular rural customer support the United States.
So once we define that trading rule once to be confident that sharing really user 2 should be able to
access those opportunities let's quickly try that out and sales force go for sharing settings and here
you can see the older beauty settings and then you'll see all the sharing rules you'll see all the sharing
rules defined for the standard objects and then you'll see the sharing rules defined for the custom
objects here and now in the scenario we are going to set up sharing rules for the opportunity object
so go for opportunity sharing rules and hit new.
Now we are going to define a sharing rule sharing rule.
As I told you it can be based on the record or not.
Audit can be based on criteria.
Now it will be based on that.
Gardner So let's fill in the details first given appropriate Lavery give a rule name and also give a
meaningful description.
Jules that only type to be record owner and he had what we are going to do we are going to share based
on the rule that as a customer support the International to customer support
not to Marika.
So this is what we are going to do.
And you can also see here that we have other options of sharing with the public groups while sharing
with trolls and subordinates.
Basically all those subordinates under that particular rule will also get access and then we can choose
what level of access basically we want to give the users.
And let me say read right and then let's share the sharing rules.
Perfect.
Now we have created a sharing for opportunities.
Now what we are going to do is now we are going to log in as the user do.
And then we are going to see if we are able to access the records.
I have logged in as user to now we haven't the opportunity staff and then I'm hitting go we basically
see all the opportunities.
So this is all sharing rules work sharing rules comes into picture when we want to further expand the
access from all WDC and really hierarchy and we can do that based on the record on it or the criteria
in this video.
We learnt about record owner and in the next few days we'll see how do we do that by using criteria
based sharing rules.