-
Notifications
You must be signed in to change notification settings - Fork 19
Description
For my current idea I have to go a bit further. By the way: During the research for a solution to my problem I became aware of FormulaShare-DX in the first place. I was looking for a solution for dynamic record sharing that adapts the Salesforce standard but allows extensions like using all(!) fields on an object and removing limitations (i.e.: max. 500 sharing rules for one object). So I wanted a solution that could be used in the same way as the Salesforce standard for defining sharing rules, with the same schema: record owner or criteria-based sharing rules, definition of criteria and who the records are shared with.
Am I correct in assuming that FormulaShare does not currently support this, right? My understanding: In FormulaShare it is necessary to specify the ID for a user, role, etc. in a specially created field, so that FS knows that this record is shared with X.
Wouldn't it be more flexible, without using additional fields, to define the criteria (which records should be selected) directly in FS? I chose exactly this approach a few weeks ago in a proprietary development. That was pretty tough for me, since it was the first time I had dealt with Apex releases in this intensity.
From today's point of view, I learned a few things that I didn't consider during my conception phase because Salesforce takes care of it itself 'under the hood':
Changing role assignments must also result in a recalculation of approvals.
About the architecture: Based on this example (https://www.apexhours.com/apex-design-patterns-leveraging-the-flexibility-of-custom-metadata-types/#comment-14665), I was able to outsource the definition of criteria to custom object. Contra: This way of outsourcing the configuration allows only AND links and no OR links. I didn't find a way to develop such a dynamic boolean argument in such a short time. However, I am convinced that, even though there may be some limitations with regard to the nesting of boolean links, it should be possible to use AND and/or OR links. After all, this is what the Salesforce standard offers in the definition of sharing rules. So it must also be possible to adapt this approach!
As you can see on the following screenshots, I lacked the knowledge that custom metadata types are able to use metadata relationships (like in FS) at the beginning of the development, so I decided to use custom objects. From the background to translate the information of technical roles, usernames etc. with an apex trigger into technical Ids.
With the following screenshots I hope the idea behind my description becomes clearer:
Best regards,
Christian

