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
Rakshana Cube84Rakshana Cube84 

User Permission assignment?

How can i set a user who can view only the records which have been creating after the day of the user creation date?
 
Sachin P Sam 1Sachin P Sam 1
@Rakshana Shree,
This cannot be achieved directly,but can be achieved by using some techniques.
  • Intially make the record private by making object private(Object to hide).
  • Add a custom field 'date created' (with date type )to the user object.
  • Then create a workflow rule for the case object (criteria -->Evaluate the rule when a record is:created.
    • Rule Criteria: User: ActiveEQUALSTrue
    • Add a field update,that updates the date created.Specify the new value using the formula-- TODAY()
  • Next move on to the object,whose record needs to be shared by sharing rule( Object made hide by making private).
    • Create a formula field 'No.of days' of return type number and add formula as, DATEVALUE(CreatedDate)-$User.xxx__Date_create__c. user created field is our custom one created intially.
  • Since this formula field can't be used in sharing condition,
    • Create a checkbox field ' visible',which is hidden from users .(default value is unchecked).
    • Using the workflow update the visiblity if the value of formula field  'No.of days' greather than 0.
  • finally create sharing rule based on the criteria,  visible EQUALS True.
This will provide your solution to Your problem.

Mark it as best answer ,if this is usefull.

Regards,
Sachin