A Visualforce page can be embedded into a standard or custom sObject
record view page, providing the standard controller for the sObject
type manages it. This technique is often used to allow information to be added to a record or its related lists without leaving the view page. The Visualforce page is embedded in the record view page using an iframe
. This means that returning a page reference to send the user to the record view page after an update results in the entire record view page being displayed inside the iframe
, as shown in the following screenshot:
In this recipe, we will create a Visualforce page that is embedded inside the standard case sObject
record view page and allows a case comment to be added directly from the page. Upon saving a case comment, the entire record view page will be refreshed to display the updated case comments related list.