You need to sign in to do that
Don't have an account?
OnDem Dev
Can Apex Managed Sharing be used in a Class declared with "with sharing" keyword?
Hi,
I am using Private sharing model on a Custom object.
As a Non-Admin user, when i try to share the record to the other users with 'Edit' or 'Read' Access level in a Class which has "with Sharing" keyword, the following exception is thrown.
Field is not writeable: <<Custom Object>>__Share.RowCause
When i remove the "with sharing" keyword from the class, then it works fine.
Can any one tell what is the issue and what is the best solution.
Thanks in advance.
Regards,
OnDem
Jim,
Thanks for the answer.
But i am not at all updating RowCause field. But it still throws Field is not Writeable exception.
Only if i remove the With Sharing keyword from the Class, then it works fine and shares the record.
Do you have any suggestions.
All the example classes which i found for Apex sharing dont use "With Sharing" keyword. Or it will be a Trigger example.
Regards,
OnDem