+ Start a Discussion
Olanre AwolowoOlanre Awolowo 

Trigger for tick "customer access" by defaulton Files

Hello, 

I am currently having an issue, we have a custom object in salesforce named Applications. I deally when that records gets created, it gets created with Files attached to the record. Then someone internally would manually change the owner of that record to a community plus user to have ownership of that record. the issue here is, once the record owner is changed the community plus user will have access to the record as the sharing model of the object is private. the issue is that even though the record owner is owned by a community plus user they do not have access to view the files attached to that record, because i am the owner of the file and the "customer access" is not checked automatically when the record owner is changed to that community user, there will be times when the Application record will be owned by an internal user and they will have access to view the files attached to the record,. but when the record is created  by an internal person and also when an internal perosn attach a file against the record , a community user wont have access to the files even if we make them the record owner. What i am trying to build is when the application record owner is changed to a community plus user or a community user, as they do have access to the record make them see the files attached to the record too. I logged this case with Salesforce and they said the only way is to build this Via a Trigger.
Would appreciate if someone could help me please build this.

Thanks
please see screenshot below. at the moment we have to do this manually to make them see the  files attached to that record once the ower is changed to themUser-added image