Trying to build a model condition that only shows records the user has read/write access to

  • 1
  • Question
  • Updated 5 months ago
  • Answered
I have a pretty straight forward application built out where a user can create an "activity" on an account via a deck. This works pretty well, but I hit a snag in the road for certain users who only have "read-only" access in Salesforce to the account records. Has anyone every successfully created a model condition that only shows the records the user has read-write access to in Salesforce?
Photo of Nicholas L.

Nicholas L.

  • 382 Points 250 badge 2x thumb

Posted 5 months ago

  • 1
Photo of Nicholas L.

Nicholas L.

  • 382 Points 250 badge 2x thumb
I should probably add that the relationship between the account table and the activity table is master/detail.
Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 17,224 Points 10k badge 2x thumb
Look into the account share object:
https://developer.salesforce.com/docs...
Photo of Nicholas L.

Nicholas L.

  • 382 Points 250 badge 2x thumb
Thanks Raymond, familiar with the table, just not sure how I could tie that into a model condition to filter out accounts.
Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 17,224 Points 10k badge 2x thumb
I didn’t play with this, but you could create a model based on the account share object. Create your conditions so that only households/activities with the access level you want are queried. This may be the only model you need depending on the level of editing you need to do on the account object.
Alternatively, you could create a second model on the account object and set a condition to only display rows that are in the accountshare model.