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.
Hope it helps you.