- Home
- Technical Library
- Boards
- Cookbook
- Code Share
- Blogs
- Partners
-
More
-
Services
- Training & Certification
- Support
-
Galleries
- Force.com Sites Gallery
- Chatter Challenge Entries
-
Other Web Sites
- Salesforce.com
- Database.com
- AppExchange
- CRM Community
-
Discussions
- Announcements
- General Development
- Schema Development
- New to Cloud Development
- Apex Code Development
- Visualforce Development
- Formulas & Validation Rules Discussion
- Security
- Mobile
- Force.com Sites
- Chatter Development
- Java Development
- .NET Development
- Perl, PHP, Python & Ruby Development
- Adobe Flash Builder for Force.com
- Desktop Integration
- REST API Integration
- Streaming API
- Visual Workflow
- Apple, Mac and OS X
- VB and Office Development
- Excel Connector
- AJAX Toolkit & S-controls
- Force.com Builder & Native Apps
- AppExchange Directory & Packaging
- Force.com Labs Projects
- Open Source
- Site.com
- Jobs Board - Administrators
- Jobs Board - Developers
- Force.com Discussion Boards
- :
- Developer Boards for Force.com and Database.com
- :
- Apex Code Development
- :
- Can Apex Managed Sharing be used in a Class declar...
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Can Apex Managed Sharing be used in a Class declared with "with sharing" keyword?
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-18-2010 09:48 AM - last edited on 01-18-2010 09:53 AM
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
Re: Can Apex Managed Sharing be used in a Class declared with "with sharing" keyword?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-19-2010 07:40 PM
Cloud Architect
Certified Salesforce.com Developer / Administrator
Xede Consulting Group
Re: Can Apex Managed Sharing be used in a Class declared with "with sharing" keyword?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-19-2010 10:33 PM
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

