0

I'm currently using flows to provide Read/Write access to records associated with a related object record using userIDs from two lookup fields.

(similar to this method: https://salesforce.stackexchange.com/a/112177)

My issue is I now need to remove a user's sharing record when the user is removed from either of the two lookup fields.

I currently have two working text fields that are populated by the PRIORVALUE of those lookup user fields, and have attempted to create a flow that will remove the user's access based on that PRIORVALUE user ID. I have very little experience with flows and automation, so I was just looking for a couple tips regarding deleting specific sharing records.

Will I need a 'Get Records' in my flow, or just a delete records action? Am I able to specify which record I am removing the users sharing rule from, or is PARENTID really just finding the right object?

0

Manual sharing rules are tracked as records in the object's Share object. Example: ContactShare or MyCustomObject__Share. You need to do a Get Records on the Share object using both ParentId and UserOrGroupId as criteria, and then you can do the Delete Records on the get result.

| improve this answer | |
  • So that's actually exactly what I have set up currently. As I was attempting to run the flow, I kept getting an error that my Fast Lookup failed to find records. It looks like the record and userID fields are not populating in my flow, although they appear to be properly assigned in the process builder. Find all Control_Record__Share records where: ParentId Equals {!varRecordID} () UserOrGroupId Equals {!varPriorRA} () Store the values of these fields in Gather_Share_Records_with_Past_RA_ID: Id, UserOrGroupId, ParentId Result Failed to find records. – Geoff Oct 30 '19 at 14:57
  • Please edit your post to include this information. – David Cheng Oct 30 '19 at 16:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.