function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
geeljiregeeljire 

Authenticated Website user cannot update own record

We use sharing sets to share records between users with an Authenticated Website license. We had a lookup field to Account in all our custom objects to facilitate the sharing. Spring '14 brought with it more options in the record-account/user-account mapping.

We've been running into a strange issue for a few days now (probably since the Spring '14 update). Although they can read/edit records in the customer portal, Authenticated Website users cannot update records they own via Visualforce. On the other hand, they can update records they do not own if these records reference their account (records shared with them) just fine.

When they try to update records they own, they encounter one of two errors:
  • If the controller is attempting the update, no exceptions are thrown in Apex, but the VF page displays Error: Data Not Available.
  • If the update is attempted by a trigger, Apex throws FATAL_ERROR|Internal Salesforce.com Error followed by System.DmlException: Insert failed. First exception on row 0; first error: INVALID_CROSS_REFERENCE_KEY, invalid cross reference id: []
The users have proper object CRUD. Create, Read, and Delete work as expected. Update only works with records that have been shared with the users, not records owned.
Vinita_SFDCVinita_SFDC
Hi,

This seems an issue with access. You have mentioned that users have Create, Read and Delete access. May be you would have missed to mention that they have Edit access as well :)

If not then please grant Edit access at profile level. If they have edit access then check is there any Apex sharing rule in your code which is restricting users from editing the record. Try to see the code flow for the affected users using debug statement.
geeljiregeeljire
Thanks, but as I already said, users have proper object CRUD. Besides, not having object permissions would affect ALL records since object CRUD supercedes record-level access.