Giving a user access to 1 record on an object.
Is it possible to give access to a record on an object if that object has the users ID who is allowed to view this on it? (The record will not be created by them)
I have never dealt with the permission side of things within Salesforce and from reading what I could I belive some of this may need to be code?
If anyone knows of any good sites, books, post which may help me acheive this it would be a massive help.
You need Apex Managed Sharing in order to accomplish this and there isn't a way (that I know of ) to do this declaratively. Now it might be possible using Process and Flows but I will have to try it out. If it works, this becomes the use case for my next blog post :)
I could but there are email triggers from this we have a prospect employee then convert this into an employee so everytime one is created it would just mean messing around, I did think of doing it like that and thank you for the input.
I thought this was the case so I created a sandbox this morning for worse case sanario :( I will give it a good read tonight and give it ago, if you come up with anything else would be great to hear.
If you are looking for resources to get you started with sharing, have a look to theses:
1. Data Sharing Module in trailhead: https://trailhead.salesforce.com/en/data_security/data_security_sharing_rules
2. Salesforce Sharing 'cheatsheet' - https://resources.docs.salesforce.com/204/latest/en-us/sfdc/pdf/salesforce_sharing_cheatsheet.pdf
Always keep in mind, the most restrictive is to be set in Orgwide Defaults. Set up > Sharing edit your object.
Then sharing rules on your object can open up access to groups (public, roles etc)
If is on adhoc basis, a particular record to a particular user, then the answer is manual sharing. (button on record, can be done by record owner or above in role hierarchy)
Hope this helps :)
Hope the answers helped, if so could you please select one of the responses as 'Best Answer'?
The selected 'Best Answer' is used to highlight the response to your question that has helped the most, so that when someone else looks at similar questions in the future quickly can identify the answer :)
Otherwise do let us know where are you at if we could help further?
It might need a few tweaks depending upon your exact use case but the premise is the same. Good luck and happy holidays!