0

I am updating the user object through site guest user, but i am getting the following error.

INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, insufficient access rights on cross-reference id:

Is there any way to avoid these error and update the normal user using "Site Guest User".

  • Could you provide more information of the issue you are facing? i.e are you trying to update a child record which is in a master-detail relationship? have you given correct field level security via profile for the object ? etc. – Ranga Aug 13 '18 at 15:10
  • Site guest users do not have access to standard object user for editing. – Rashmi S Aug 13 '18 at 15:12
0

Each guest user (site) has a unique profile (public access settings).These profiles are associated to guest user licenses which give the ability to read/create on standard objects and full CRUD on custom objects. However, by default no CRUD is given. Admins needs to enable the right level of access based on their flow

In order to enable standard objects’ edit permission for such a client on Force.com site using guest user login can be achieved via a Visualforce page hosted in Force.com sites without any spending on community licenses.

the one that requires minimum setup in Salesforce configuration is the use of MAPS. In this approach,instead of using binding variables in Visualforce pages, we use a Map to track the updated fields on the page. The fields are just standard HTML input fields. The value in the field will be the value of the Map with ID as the corresponding key.

In solution, basically what happens behind the scene is described below: There is no direct binding of a field from Visualforce page to the database. Whatever change that is made in the page is captured in the apex class. Here, a map is created which maps the user input value to a unique ID of the record that needs to be updated.Using the unique IDs, the apex fetches all the records from the database and manually updates the database with the corresponding value present in the map.This approach eliminates the need of using dummy objects and extra trigger to get the job done.

Ideally the solution on the Visualforce page to work like this: The guest user is given a Visualforce page URL with the Opportunity ID mentioned in the below format: http://name/id-xxxxxxxxxxxxxxxx/

The opportunity ID is a 15digit number specific to that opportunity. The client can view all the product details on the Visualforce page related to that particular opportunity ID.When the client makes an update to any prod- uct details the same get updated in the database as well. Similarly, changes made to the DB will be reflected in the Visualforce page also. This happens due to the binding between Visualforce page and the DB. The Apex code acts as the mediator facilitating the back and forth journey of data.

Reference:- https://suyati.com/resources/

Hope it helps you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.