We use a Customer Community to dispatch Work Orders to partners. The partners use Customer Community Plus licenses. We share the Work Order using a community sharing set, but we cannot share the account the same way - because multiple partners might work on multiple work orders to the same account and therefore all partners need access to the same account.
Because our organization wide external sharing model for Accounts is "Private", I must manually share these accounts. I tried a trigger-based solution that inserts
AccountShare, but unfortunately, I cannot get it to work: The shares get created, the partner as access to the community, and approximately 15 to 30 minutes later the partner cannot access the account any more. When inspecting
AccountShare in the developer console, the respective share is gone.
I understand, that "Manual" shares are highly volatile and I need to account for use cases like owner change. I did, and still the shares magically disappear. Can anybody tell me, why?